Networking
Networking
Networking
Network Connection
When the Network layer receives a call request from the transport layer, it establishes a
network connection across the subnetwork. For this, it makes use of data link connections. The
end system's network layer interacts with the network layer of the subnetwork access point for
this purpose.
Routing
The Network Layer selects an appropriate route between source and destination device. This
route is either decided in the beginning or for each N-SDU, depending on the type of services.
The routing functions are facilitated by sub layering of the network layer.
Multiplexing
For optimum use of data link connections, many network connections are sometimes required
to be multiplexed on a single data-link connection. This is done by a network entity that can
multiplex several network connections on a data link connection, as shown in the figure.
Error Detection
The network layer uses error detection functions to ensure that the quality of service provided
over the network connection is maintained. Most of the errors are detected and corrected at
the data link layer. The residual errors, Network Layer, notifies any. It relies on the quality of
service provided, and the network layer incorporates the mechanism for error recovery.
Other Functions
The network service data unit is segmented at the network layer, and blocking is done to
produce a network protocol data unit (N-PDU). The delimiter of NSDU is preserved during
segmenting and blocking.
The process is shown in the figure. The network entity also carries out sequencing and flow
control of network service data units on request of the transport layer. At the request of the
transport layer, it can reset the network connection too.
From <https://www.tutorialspoint.com/what-are-the-functions-of-network-layer>
ARP
Address Resolution Protocol is one of the most important protocols of the
network layer in the OSI model which helps in finding the MAC(Media
Access Control) address given the IP address of the system i.e. the main duty
of the ARP is to convert the 32-bit IP address(for IPv4) to 48-bit address i.e.
the MAC address.
• If the MAC address is not present in the ARP table then the source
device will generate an ARP Request message. In the request message
the source puts its own MAC address, its IP address, destination IP
address and the destination MAC address is left blank since the source
is trying to find this.The source device will broadcast the ARP request
message to the local network.
• The broadcast message is received by all the other devices in the LAN
network. Now each device will compare the IP address of the
destination with its own IP address. If the IP address of destination
matches with the device's IP address then the device will send an ARP
Reply message. If the IP addresses do not match then the device will
simply drop the packet.
• The device whose IP address has matched with the destination IP
address in the packet will reply and send the ARP Reply message. This
ARP Reply message contains the MAC address of this device. The
destination device updates its ARP table and stores the MAC address of
the source as it will need to contact the source soon. Now, the source
becomes destination(target) for this device and the ARP Reply message
is sent.
• The ARP reply message is unicast and it is not broadcasted because the
source which is sending the ARP reply to the destination knows the
MAC address of the source device.
• When the source receives the ARP reply it comes to know about the
destination MAC address and it also updates its ARP cache. Now the
packets can be sent as the source nows destination MAC address.
From <https://afteracademy.com/blog/what-is-arp-and-how-does-it-work/>
1. Error Message
2. Query Message
From <https://afteracademy.com/blog/what-are-icmp-and-igmp-protocols/>
IPv4
IP version 4 is the older version. It uses 32 bits to create a single uniques
address on the internet. IPv4 is limited to 4,294,967,296 addresses
i.e. 2³² addresses. It consists of four numbers each of which can contain one
to three digits ranging from 0 to 255 separated by a single dot(.). Here, each
number is the decimal representation(base-10) for an 8 digit binary
number(base-2). These IP addresses pretty much guarantee that our emails
will come and go as expected, our google searches would take us to the
website where we want and so many other things that we do on the
internet.
In the above IP address, four groups contain only zeros. This zero can be
replaced by a colon and can be re-written as adba:1925::8a2e:7334.
From <https://afteracademy.com/blog/difference-between-ipv4-and-ipv6/>
Following are the three steps involved in establishing the connection using
the 3-way handshake process in TCP:
1. The client sends the SYN to the server: When the client wants to
connect to the server. It sets the 'SYN' flag as 1 and sends the message
to the server. The message has also some additional information like
the sequence number(any random 32 bits number), the ACK is set here
to 0, the window size, and the maximum segment size. For Example, if
the window size is 2000 bits, and the maximum segment size is 200 bits
then a maximum of 10 data segments (2000/200 = 10) can be
transmitted in the connection.
2. The server replies with the SYN and the ACK to the client: After
receiving the client's synchronization request, the server sends an
acknowledge to the client by setting the ACK flag to '1'. The
acknowledgement number of the ACK is one more than the received
sequence number. For Example, if the client has sent the SYN with
sequence number = 1000, then the server will send the ACK with
acknowledgement number = 10001. Also, the server sets the SYN flag to
'1' and sends it to the client, if the server also wants to establish the
connection. The sequence number used here for the SYN will be
different from the client's SYN. The server also advertises its window
size and maximum segment size to the client. After completion of this
step, the connection is established from the client to the server-side.
3. The client sends the ACK to the server: After receiving the SYN from the
server, the client sets the ACK flag to '1' and sends it with an
acknowledgement number 1 greater than the server's SYN sequence
number to the client. Here, the SYN flag is kept '0'. After completion of
this step, the connection is now established from the server to the
client-side also. After the connection is being established, the minimum
of the sender's and receiver's maximum segment size is taken under
consideration for data transmission.
Below is the pictorial representation of the connection termination using
the 3-way handshake process.
Following are the three steps involved in terminating the connection using
the 3-way handshake process in TCP:
1. The client sends the FIN to the server: When the client wants to
terminate the connection. It sets the FIN flag as '1' and sends the
message to the server with a random sequence number. Here, the ACK
is set to 0.
2. The server replies with the FIN and the ACK to the client: After
receiving the client's termination request, the server sends an
acknowledge to the client by setting the ACK flag to '1'. The
acknowledgement number of the ACK is one more than the received
sequence number. For Example, if the client has sent the FIN with
sequence number = 1000, then the server will send the ACK with
acknowledgement number = 10001. Also, the server sets the FIN flag to
'1' and sends it to the client, if the server also wants to terminate the
connection. The sequence number used here for the FIN will be
different from the client's FIN. After completion of this step, the
connection is terminated from the client to the server-side.
3. The client sends the ACK to the server: After receiving the FIN from the
server, the client sets the ACK flag to '1' and sends it with an
acknowledgement number 1 greater than the server's FIN sequence
number to the client. Here, the FIN flag is kept '0'. After completion of
this step, the connection is now terminated from the server to the
client-side also.
From <https://afteracademy.com/blog/what-is-a-tcp-3-way-handshake-process/>