Pages

Saturday, 26 November 2022

ACN short questions : HTPS vs FTP vs SMTP , IPV6

 Differences : HTPS vs FTP vs SMTP

 
List of features of IPv4:

Address Structure:
An IPv6 address is made of 128 bits divided into eight 16-bits blocks. Each block is then converted into 4-digit Hexadecimal numbers separated by colon symbols.

For example, given below is a 128 bit IPv6 address represented in binary format and divided into eight 16-bits blocks:

0010000000000001 0000000000000000 0011001000111000 1101111111100001 0000000001100011 0000000000000000 0000000000000000         1111111011111011
Each block is then converted into Hexadecimal and separated by ‘:’ symbol:
2001:0000:3238:DFE1:0063:0000:0000:FEFB

1. Larger Address Space
The IPV6 uses four times more bits for addressing a device on the internet as compared to IPV4, and the space provided by it is 3.4 x 10 ^ 38 devices; the address space provided by IPV6 may fulfill the requirement to allocate addresses all over the world means it can be allocated to everywhere on the earth in a square meter, this the main feature of the IPV6.

2. Simplified Header
The header of the IPV6 is twice bigger than the header provided by IPV4 on the other hand, the address provided by it is 4× more than IPV4, IPV6 header is not complex but easy to process while in IPV4, the header is complex, so by simplifying in IPV6 we need to move all the information from the header of it to the end of its header.

3. End-to-end Connectivity
The end-to-end connectivity feature in internet protocol, as of now every system has an IP address which is to be unique it can cross the internet without translating other components, it is fully implemented on the internet each host can access the other host directly, but there may have some restrictions like firewall, and policies of the organization may restrict.

4. Auto-configuration
The auto-configuration is the process to verify uniqueness on a link; it also determines the information that should be auto-configured, it supports stateful configuration mode to keep track of each assignment as well as it also supports the stateless auto-configuration in which there is no need to configure manually because it automatically generates the IPV6 addresses.

5. Faster Routing or Forwarding
The information which is present at the first part of the header is enough to make routing decisions as we know this is the simplified header feature as we have seen above, and due to the information present at header the IPV6 can make routing decisions faster, in this, we can say that IPV6 is faster in routing.

6. IPSec
This is an optional feature provided by IPV6 to give security of IPSec type, which is more secure than IPV4 and IPSec is used at the network or packet processing layer to secure the network.

7. Aggregation
The aggregation is another feature of IPV6, which allows using a single prefix for the entire network, which is easy and flexible to promote efficient and scalable routing.

8. No Broadcast
The IPV6 uses multicast address instead of broadcast address because it does not support the broadcast address, by using multicast address it communicates with the multiple hosts, it also has anycast mode which is a new type of address, a network device sends a packet to a multicast address then the device broadcast the packet to all interfaces which are identified by the address.

9. Anycast Support
Anycast is the featuring provided by IPV6 that is the mode of packet routing; on the internet, by using the anycast mode, the same anycast IP address can assign multiple interfaces, we can say that this is the address we can assign to multiple interfaces or set of interfaces, in this way IPV6 support the anycast.

10. Mobility
This feature of IPV6 allows the host, like a mobile phone, to keep the device connected in different geographic areas by using the same IP address, the mobility in IPV6 can assign an IP address to the mobile node within its home network, and the mobile node of the home address is useful to reach their destination.

11. Enhanced Priority Support
This is another feature of the IPV6 to check the priority support that IPV4 provided the quality of services where it used 6 bits Differential Service Code Point that is DSCP, and 2 bits Explicit Congestion Notification that is ECN but that can be used only when there is an end-to-end devices support so the underlying network like source and destination may support to it.

12. Smooth Transition
The smooth transition is the transition technique in IPV6 which is upgraded from IPV4 based on the up-to-date IPV6 technique, by the feature of the large IP address in IPV6 allow to assign the same IP address globally so devices can send and receive data within the network, the router in it can forward the decisions quickly rather the header is less loaded, and another enhancement is that all routers in one path need to do recalculation for IPV6 packet instead of error detection which is handled by the data link layer.

13. Extensibility
Extensibility is the major advantage of the IPV6; it is extensible so that it can add more information in the options section, the IPV6 has a large size packet where the IPV4 has less than IPV6 so that IPV4 can support 40-byte options only, in this way of adding extension header after the IPV6 header IPV6 can easily be extended, and the size of its extension is mannered by the size of its packets.

Local & Global address:

Global Addressing: A source or a destination needs to have a global address-an address that can be unique in the scope of the network or internationally.

Local Addressing: The identifier that is actually used for data transfer is called the virtual-circuit identifier (VCI). A VCI, unlike a global address, is a small number that has only switch scope; it is used by a frame between two switches. When a frame arrives at a switch, it has a VCI; when it leaves, it has a different VCI.

Difference between Switch and Router:
RouterSwitch
The main objective of router is to connect various networks simultaneously.While the main objective of switch is to connect various devices simultaneously.
It works in network layer.While it works in data link layer.
Router is used by LAN as well as MAN.While switch is used by only LAN.
Through the router, data is sent in the form of packets.While through switch data is sent in the form of  frame.
There is less collision taking place in the router.While there is no collision taking place in full duplex switch.
Router is compatible with NAT.While it is not compatible with NAT.
The types of routing are: Adaptive and Non-adaptive routing.The types of switching are: Circuit, Packet,and Message Switching.

Wednesday, 14 September 2022

LAYERED TASKS : Open System Interconnection & TCP/IP Model

LAYERED TASKS

We use the concept of layers in our daily life. As an example, let us consider two friends who communicate through postal mail the process of sending a letter to a friend would be complex if there were no services available from the post office.

Sender, Receiver, and Carrier

At the Sender Site

Let us first describe, in order, the activities that take place at the sender site.

• Higher layer. The sender writes the letter, inserts the letter in an envelope, writes the sender and receiver addresses, and drops the letter in a mailbox.

• Middle layer. The letter is picked up by a letter carrier and delivered to the post office.

• Lower layer. The letter is sorted at the post office; a carrier transports the letter.

0n the Way: The letter is then on its way to the recipient. On the way to the recipient's local post office, the letter may actually go through a central office. In addition, it may be transported by truck, train, airplane, boat, or a combination of these.

At the Receiver Site

• Lower layer. The carrier transports the letter to the post office.

• Middle layer. The letter is sorted and delivered to the recipient's mailbox.

• Higher layer. The receiver picks up the letter, opens the envelope, and reads it. 


Reference Models:

In computer networks, reference models give a conceptual framework that standardizes communication between heterogeneous networks.

The two popular reference models are −
•OSI Model
•TCP/IP Protocol Suite

OSI(Open System Interconnection) Model:
  • OSI stands for Open Systems Interconnection
  • Created by International Standards Organization (ISO)
  • Was created as a framework and reference model to explain how different networking technologies work together and interact
  • It is not a standard that networking protocols must follow
  • Each layer has specific functions it is responsible for
  • All layers work together in the correct order to move data around a network

Application Layer: Contains all services or protocols needed by application software or operating system to communicate on the network

Examples
–Firefox web browser uses HTTP (Hyper-Text Transport Protocol)
–E-mail program may use POP3 (Post Office Protocol version 3) to read e-mails and SMTP (Simple Mail Transport Protocol) to send e-mails

Presentation Layer: Concerned with how data is presented to the network
•Handles three primary tasks: 
 Translation , Compression , Encryption

Session Layer

  • Responsible for managing the dialog between networked devices
  • Establishes, manages, and terminates connections
  • Provides duplex, half-duplex, or simplex communications between devices
  • Provides procedures for establishing checkpoints,  adjournment,  termination, and restart or recovery procedures
Transport Layer
  • Takes data from higher levels of OSI Model and breaks it into segments that can be sent to lower-level layers for data transmission
  • Conversely, reassembles data segments into data that higher-level protocols and applications can use
  • Also puts segments in correct order (called sequencing ) so they can be reassembled in correct order at destination
  • Concerned with the reliability of the transport of sent data
  • May use a connection-oriented protocol such as TCP to ensure destination received segments
  • May use a connectionless protocol such as UDP to send segments without assurance of delivery
  • Uses port addressing
Network Layer 
  • Responsible for moving packets (data) from one end of the network to the other, called end-to-end communications
  • Requires logical addresses such as IP addresses
  • Device example: Router
  • Routing is the ability of various network devices and their related software to move data packets from source to destination
Data Link Layer
  • Is responsible for moving frames from node to node or computer to computer
  • Can move frames from one adjacent computer to another, cannot move frames across routers
  • Encapsulation = frame
  • Requires MAC address or physical address
  • Protocols defined include Ethernet Protocol and Point-to-Point Protocol (PPP)
  • Device example: Switch,Bridge
  • Two sublayers: Logical Link Control (LLC) and the Media Access Control (MAC)
Logical Link Control (LLC)
  • Data Link layer addressing, flow control, address notification, error control
Media Access Control (MAC)
  • Determines which computer has access to the network media at any given time
  • Determines where one frame ends and the next one starts, called frame
  • synchronization
Physical Layer
  • Deals with all aspects of physically moving data from one computer to the next
  • Converts data from the upper layers into 1s and 0s for transmission over media
  • Defines how data is encoded onto the media to transmit the data
  • Defined on this layer: Cable standards, wireless standards, and fiber optic standards.
  • Copper wiring, fiber optic cable, radio frequencies, anything that can be used to transmit data is defined on the Physical layer of the OSI Model
  • Device example: Hub, Repeater
  • Used to transmit data

An exchange using the OSI model



TCP/IP Model (Transmission Control Protocol/Internet Protocol):
A protocol suite is a large number of related protocols that work together to allow networked computers to communicate
Application Layer
Application layer protocols define the rules when implementing specific network applications Rely on the underlying layers to provide accurate and efficient data delivery
Typical protocols:
  • FTP – File Transfer Protocol
    • For file transfer
  • Telnet – Remote terminal protocol
    • For remote login on any other computer on the network
  • SMTP – Simple Mail Transfer Protocol
    • For mail transfer
  • HTTP – Hypertext Transfer Protocol
    • For Web browsing
Transport Layer 
•TCP is a connection-oriented protocol
  • Does not mean it has a physical connection between sender and receiver
  • TCP provides the function to allow a connection virtually exists – also called virtual circuit
•UDP provides the functions:
  •   Dividing a chunk of data into segments
  •   Reassembly segments into the original chunk
  •   Provide further the functions such as reordering and data resend
  •   Offering a reliable byte-stream delivery service
  •   Functions the same as the Transport layer in OSI
  •   Synchronize source and destination computers to set up the session between the respective computers

Internet Layer
• The network layer, also called the internet layer, deals with packets and connects independent networks to transport the packets across network boundaries. The network layer protocols are the IP and the Internet Control Message Protocol (ICMP), which is used for error reporting.

Host-to-network layer
The Host-to-network layer is the lowest layer of the TCP/IP reference model. It  combines  the  link layer and  the  physical layer of  the  ISO/OSI  model.  At this layer, data is transferred between adjacent network nodes in a WAN or between nodes on the same LAN.

OSI Model Vs TCP/IP Model:


Introduction to Computer Networks

Syllabus of unit 1:
DATA COMMUNICATION: Characteristics, Components, Data flow, Network criteria, Topologies, Network model, Layered tasks, ARPANET, OSI model, TCP/IP protocol suite, Addressing 
PHYSICAL LAYER: Transmission Media: Guided and unguided, Connecting devices: Hub, switch, bridge, router, Gateway.

A network is a set of devices (often referred to as nodes) connected by communication links. A node can be a computer, printer, or any other device capable of sending and/or receiving data generated by other nodes on the network.

“Computer network’’ means a collection of autonomous computers interconnected by a single technology. Two computers are said to be interconnected if they are able to exchange information.

The connection need not be via a copper wire; fiber optics, microwaves, infrared, and communication satellites can also be used, with  the Internet being the most well-known example of a network of networks.

There is considerable confusion in the literature between a computer network and a distributed system. The key distinction is that in a distributed system, a collection of independent computers appears to its users as a single coherent system. Usually, it has a single model or paradigm that it presents to the users. Often a layer of software on top of the operating system, called middleware, is responsible for implementing  this  model.  A  well-known example of a distributed system is the World Wide Web. It runs on top of the Internet and presents a model in which everything looks like a document (Web page).

A network must be able to meet certain criterias, these are mentioned below:

Performance
Reliability
Scalability 

Performance: It can be measured in the following ways:
Transit time : It is the time taken to travel a message from one device to another.
Response time : It is defined as the time elapsed between enquiry and response.
Other ways to measure performance are :
·       Efficiency of software
·       Number of users        
·       Capability of connected hardware
 

Reliability: It decides the frequency at which network failure take place. More the failures are, less is the network's reliability.

Security: It refers to the protection of data from any unauthorized user or access. While travelling through network, data passes many layers of network, and data can be traced if attempted. Hence security is also a very important characteristic for Networks.

USES OF COMPUTER NETWORKS

1. Business Applications

• To distribute information throughout the company (resource sharing). sharing physical resources such as printers, and tape backup systems, is sharing information

• client-server model. It is widely used and forms the basis of much network usage.

• communication medium among employees. email (electronic mail), which employees generally use for a great deal of daily communication.

• Telephone calls between employees may be carried by the computer network instead of by the phone company. This technology is called IP telephony or Voice over IP (VoIP) when Internet technology is used.

• Desktop sharing lets remote workers see and interact with a graphical computer screen

• Doing business electronically, especially with customers and suppliers. This new model is called e-commerce (electronic commerce) and it has grown rapidly in recent years.

2.Home Applications

• peer-to-peer communication

• person-to-person communication

• electronic commerce

• entertainment.(game playing,)

3.Mobile Users

• Text messaging or texting

• Smart phones,

• GPS (Global Positioning System)

• m-commerce

• NFC (Near Field Communication)

4.Social Issues

With the good comes the bad, as this new-found freedom brings with it many unsolved social, political, and ethical issues. 

Social networks, message boards, content sharing sites, and a  host  of other applications allow people to share their views with  like-minded individuals. As long as the subjects are restricted to technical topics or hobbies like gardening, not too many problems will arise.

The trouble comes with topics that people actually care about, like politics, religion, or sex. Views that are publicly posted may be deeply offensive to some people. Worse yet, they may not be politically correct. Furthermore, opinions need not be limited to text; high-resolution color photographs and video clips are easily shared over computer networks. Some people take a live-and-let-live view, but others feel that posting certain material (e.g., verbal attacks on particular countries or religions, pornography, etc.) is simply unacceptable and that such content must be censored. Different countries have different and conflicting laws in this area. Thus, the debate rages.

Computer networks make it very easy to communicate. They also make it easy for the people who run the network to snoop on the traffic. This sets up conflicts  over  issues  such  as  employee  rights  versus  employer   rights. Many people read and write email at work. Many employers have claimed the right to read and possibly censor employee messages, including messages sent from a home computer outside working hours. Not all employees agree with this, especially the latter part.

Another conflict is centered around government versus citizen’s rights.A new twist with mobile devices is location privacy. As part of the process of providing service to your mobile device the network operators learn where you are at different times of day. This allows them to track your movements. They may know which nightclub you frequent and which medical center you visit.

Phishing ATTACK: Phishing is a type of social engineering attack often used to steal user data, including login credentials and credit card numbers. It occurs when an attacker, masquerading as a trusted entity, dupes a victim into opening an email, instant message, or text message.

BOTNET ATTACK: Botnets can be used to perform distributed denial-of-service attack (DDoS attack), steal data, send spam, and allows the attacker to access the device and its connection.

Data Communications System :

The effectiveness of a data communications system depends on  four fundamental characteristics: delivery, accuracy, timeliness, and jitter.

I. Delivery. The system must deliver data to the correct destination. Data must be received by the intended device or user and only by that device or user.

2 Accuracy. The system must deliver the data accurately. Data that have been altered in transmission and left uncorrected are unusable.

3.Timeliness. The system must deliver data in a timely  manner.  Data delivered late are useless. In the case of video and audio, timely delivery means delivering data as they are produced, in the same order that they are produced, and without significant delay. This kind of delivery is called real-time transmission.

4.Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven delay in the delivery of audio or video packets. For example, let us assume that video packets are sent every 30 ms. If some of the packets arrive with 30-ms delay and others with 40-ms delay, an uneven quality in the video is the result.

A data communications system has five components

1.Message. The message is the information (data) to be communicated. Popular forms of information include text, numbers, pictures, audio, and video. 

2 Sender. The sender is the device that sends the data message. It can be a computer, workstation, telephone handset, video camera, and so on.

3.Receiver. The receiver is the device that receives the message. It can be a computer, workstation, telephone handset, television, and so on.

4.Transmission medium. The transmission medium is the physical path by which a message travels from sender to receiver. Some examples of transmission media include twisted-pair wire, coaxial cable, fiber-optic cable, and radio waves.

5.Protocol. A protocol is a set of rules that govern data communications. It represents an agreement between the communicating devices. Without a protocol, two devices may be connected but not communicating, just as a person speaking French cannot be understood by a person who speaks only Japanese.

Data Flow
Communication between two devices can be simplex, half-duplex, or full-duplex as shown in Figure.
Simplex 
In simplex mode, the communication is unidirectional, as on a one- way street. Only one of the two devices on a link can transmit; the other can only receive (Figure a). Keyboards and traditional monitors are examples of simplex devices.

Half-Duplex
In half-duplex mode, each station can both transmit and receive, but not at the same time. When one device is sending, the other can only receive, and vice versa (Figure b). Walkie-talkies and CB (citizens band) radios are both half- duplex systems.

Full-Duplex
In full-duplex, both stations can transmit and receive simultaneously (Figure c). One common example of full-duplex communication is the telephone network. When two people are communicating by a telephone line, both can talk and listen at the same time. The full-duplex mode is used when communication in both directions is required all the time.

Tuesday, 16 August 2022

Installation of contiki 3.0 on ubuntu20.04

root@ubuntu:/home/ubuntu$ sudo -s

root@ubuntu:/home/ubuntu# 

root@ubuntu:/home/ubuntu#  wget https://github.com/contiki-os/contiki/archive/3.0.zip

root@ubuntu:/home/ubuntu#  unzip 3.0.zip


Monday, 15 August 2022

Instant contiki 2.7

 Go to google search and type instant contiki 2.7 download 




Download the file of size 2.2GB and open with VM Ware Machine 
 

Friday, 12 August 2022

ACN- Cyclic redundancy check (CRC)

Checksum


 

Cyclic redundancy check (CRC):

 



How to Install and Uninstall Java on Ubuntu

Step1: Installing Java on Ubuntu

You can install one or several Java packages. You can also decide which version you want on your system by installing a specific version number. The current default and LTS version is Java 11.

Install OpenJDK

1. Open the terminal (Ctrl+Alt+T) and update the package repository to ensure you download the latest software version:

sudo apt update

2. Then, you can confidently install the latest Java Development Kit with the following command:

sudo apt install default-jdk

Install Specific Version of OpenJDK

You may decide to use Open JDK 8, instead of the default OpenJDK 11.

To do so, open the terminal and type in the following command:

sudo apt install openjdk-8-jdk

Once the installation process is complete, verify the current Java version:

java -version; javac -version

How to find the OpenJDK directory with the following command:

readlink -f /usr/bin/javac

How to Set Default Java Version

As you can have multiple versions of Java installed on your system, you can decide which one is the default one.First, run a command that shows all the installed versions on your computer:

sudo update-alternatives --config java

step 2: Uninstall Java on Ubuntu

In case you need to remove any of the Java packages installed, use the apt remove or purge command. To remove Open JDK 11, run the command:

sudo apt remove default-jdk

To uninstall OpenJDK 8:

sudo apt remove openjdk-8-jdk

2nd Method:

1. sudo dpkg --list | grep -i jdk 

2. sudo apt-get purge Oracle-java8-installer

Thursday, 11 August 2022

contiki ng -GNU Mode

Open the terminal

ctrl +alt + t

vl@ubuntu:~/contiki-ng$ cd tools

vl@ubuntu:~/contiki-ng/tools$ ls

vl@ubuntu:~/contiki-ng/tools$ cd cooja

vl@ubuntu:~/contiki-ng/tools/cooja$ update-alternatives --config java

// it may not change unless we do in root 

vl@ubuntu:~/contiki-ng/tools/cooja$ sudo -s
[sudo] password for vl:
root@ubuntu:/home/vl/contiki-ng/tools/cooja# update-alternatives --config.java


root@ubuntu:/home/vl/contiki-ng/tools/cooja# ant run



contiki ng -Terminal mode

open the terminal 

ctrl + alt + t


create a folder rk and copy helloworld.c and  makefile from examples folder

vl@ubuntu:~/contiki-ng/examples$ mkdir rk
vl@ubuntu:~/contiki-ng/examples$ ls
6tisch       ip64-router         nullnet            slip-radio
benchmarks   ledprg              platform-specific  snmp-server
coap         libs                rk                 storage
cplusplus    lwm2m-ipso-objects  rpl-border-router  websocket
dev          mqtt-client         rpl-udp
hello-world  multicast           sensniff
vl@ubuntu:~/contiki-ng/examples$ cd rk
vl@ubuntu:~/contiki-ng/examples/rk$ ls
vl@ubuntu:~/contiki-ng/examples/rk$ cp ../hello-world/hello-world.c .
vl@ubuntu:~/contiki-ng/examples/rk$ cp ../hello-world/Makefile .
vl@ubuntu:~/contiki-ng/examples/rk$ ls
hello-world.c  Makefile
 

Now rename hello-world.c to myown.c

vl@ubuntu:~/contiki-ng/examples/rk$ mv hello-world.c myown.c

set the Makefile to myown as shown


Now create myown.c file

#include "contiki.h"

#include <stdio.h> /* For printf() */
/*---------------------------------------------------------------------------*/
PROCESS(myown_process, "I am on My Own");
AUTOSTART_PROCESSES(&myown_process);
/*---------------------------------------------------------------------------*/
//Protothread
PROCESS_THREAD(myown_process, ev, data)
{
  static struct etimer timer;//static is used here to store the timer in RAM

  PROCESS_BEGIN();

  /* Setup a periodic timer that expires after 10 seconds. */
  etimer_set(&timer, CLOCK_SECOND * 5);

  while(1) { //super loop architecture
    printf("Hello Friends  Welcome to IoT\n");

    /* Wait for the periodic timer to expire and then restart the timer. */
    PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&timer));
    etimer_reset(&timer);
  }

  PROCESS_END();
}
/*---------------------------------------------------------------------------*/

Run:

vl@ubuntu:~/contiki-ng/examples/rk$ make
 

vl@ubuntu:~/contiki-ng/examples/rk$ ls
build  Makefile  myown.c  myown.native

vl@ubuntu:~/contiki-ng/examples/rk$ make TARGET=native
make: Nothing to be done for 'all'.
 

vl@ubuntu:~/contiki-ng/examples/rk$ make clean
TARGET not defined, using target 'native'
 

vl@ubuntu:~/contiki-ng/examples/rk$ make TARGET=native
 

vl@ubuntu:~/contiki-ng/examples/rk$ ./myown.native

 

Wednesday, 10 August 2022

LED Display

 create a folder ledprg in contiki/examples

copy the makefile from helloworld into the above created folder 


create a file led.c in ledprg folder


//led.c

#include "contiki.h"
#include <stdio.h>

#include "dev/leds.h"
#include "dev/button-sensor.h"

PROCESS(led_process, "LED Process");

AUTOSTART_PROCESSES(&led_process);
PROCESS_THREAD(led_process,ev,data)
{

PROCESS_BEGIN();
SENSORS_ACTIVATE(button_sensor);

while(1)
{
printf("Press the Button of the sensor\n");
PROCESS_WAIT_EVENT_UNTIL(ev==sensors_event && data==&button_sensor);
leds_toggle(LEDS_GREEN);
}

printf("The sensor value is %u \n",leds_get());
PROCESS_END();
}

//Makefile


see that both the files are in the same folder ledprg

RUN THE PROGRAM:

vl@ubuntu:~/contiki-ng/examples/ledprg$ make TARGET=native


Note :

if there is an error regarding gcc version

wget http://www.netgull.com/gcc/releases/gcc-4.8.0/gcc-4.8.0.tar.bz2
 

To extract the file:

tar -xvjf gcc-4.8.0.tar.bz2

Install some additional libraries (sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev libc6-dev)

Compile the source: ./gcc-4.8.0/configure --prefix=/app/gcc/4.8.0
 

Run make (This will take some time to complete. Go make some coffee, or bake some cookies. ;-))
 

Install the code: sudo make install


sudo dpkg --add-architecture i386
sudo apt update
sudo apt upgrade
sudo apt-get install gcc-multilib libstdc++6:i386
wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.bz2 --no-check-certificate
tar xf gcc-4.8.5.tar.bz2
# cd gcc-4.8.5
# ./contrib/download_prerequisites
# cd ..
sed -i -e 's/__attribute__/\/\/__attribute__/g' gcc-4.8.5/gcc/cp/cfns.h
sed -i 's/struct ucontext/ucontext_t/g' gcc-4.8.5/libgcc/config/i386/linux-unwind.h
mkdir xgcc-4.8.5
pushd xgcc-4.8.5
$PWD/../gcc-4.8.5/configure --enable-languages=c,c++ --prefix=/usr --enable-shared --enable-plugin --program-suffix=-4.8.5
make MAKEINFO="makeinfo --force" -j
sudo make install -j

Monday, 8 August 2022

Contiki NG Installation in Ubuntu 20.04

Start by installing some necessary packages:

$ sudo apt update 

$ sudo apt install build-essential doxygen git curl wireshark python3-serial srecord rlwrap

While installing Wireshark, select enable the feature that lets non-superuser capture packets (select "yes"). 

$ sudo apt install autoconf automake libxmu-dev


To install GCC for ARM controller 

$ wget https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2


Extract this file in the home folder itself. 

root@ubuntu:/home/ubuntu# tar xvf gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2

To open the above file using a terminal

vl@ubuntu:~/gcc-arm-none-eabi-5_2-2015q4-20151219-linux$ pwd
/home/vl/gcc-arm-none-eabi-5_2-2015q4-20151219-linux
vl@ubuntu:~/gcc-arm-none-eabi-5_2-2015q4-20151219-linux$ cd
vl@ubuntu:~$ pwd
/home/vl
vl@ubuntu:~$ gedit .bashrc

set the above in the PATH Environment. 

/home/vl/.bashrc as:

export PATH=$PATH:/home/vl/gcc-arm-none-eabi-5_2-2015q4-20151219-linux/bin 

To check the added path use the commnad 

$ echo $PATH

 
$ sudo apt install gcc-msp430
 

$ sudo apt install default-jdk ant
 


Add this path in .bashrc file 

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java 


CoAP Client 

$ sudo apt-get install -y npm && sudo apt-get clean && sudo npm install coap-cli -g && sudo ln -s /usr/bin/nodejs /usr/bin/node

MQTT Clients 

$ sudo apt-get install -y mosquitto mosquitto-clients

Configuration Completed. 

 

Download Contiki NG 

vl@ubuntu:~$ git clone https://github.com/contiki-ng/contiki-ng.git 
$ cd contiki-ng 
$ git submodule update --init --recursive

 
How to run cooja :
make // for first program
make clean // for next program we need to do
 



To view Cooja simulator:
$ sudo ant run 


Peer-to-Peer Networks

  Peer-to-Peer (P2P) networks are a decentralized type of network architecture where each device (or node) on the network can act as both a...