0% found this document useful (0 votes)
32 views2 pages

Application Layer Explainations

The document describes the layers of the OSI model and the process of establishing a TCP connection between a client and server. It explains how the client's networking stack formats packets that pass through each layer, including the physical, data link, network, and transport layers. It then outlines the routing process, where the client's request is sent to a router and passed to the server's network based on the router's routing table and IP addresses.

Uploaded by

alex joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

Application Layer Explainations

The document describes the layers of the OSI model and the process of establishing a TCP connection between a client and server. It explains how the client's networking stack formats packets that pass through each layer, including the physical, data link, network, and transport layers. It then outlines the routing process, where the client's request is sent to a router and passed to the server's network based on the router's routing table and IP addresses.

Uploaded by

alex joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Physical layer: The physical device that interconnects the computers, their specification and how the

signal is sent over this connection all comes in the physical layer.

Data link layer: It is all about defining a common way to interpret these signals so that a device can
communicate with each other. The most common protocol is Ethernet.

Network layer: It allows different networks to communicate with each other using devices called
routers and switches

Transport layer: The transport layer finds which client and server programs are supposed to get that
data. The most common protocol used is TCP/IP.

MAC address: It is the address embedded in your hardware device which will constitute a node of
the network permanently during its manufacturing.

IP address: Unlike the Mac address, it is not permanent and not embedded on any hardware it is the
address of network it might change when you are at home connected with the WIFI and different
when you are connected with the railway station's WIFI even the devices in both cases are same.

TCP port: A port is a 16-bit number that's used to direct traffic to specific services running on a
networked computer. For example, port 80 is a port in which a web server listens for the web
request.

Checksum check: It is a method used to check the correctness of data during the transmission from
one place to another.

Routing table: It is a table in which the router device used to locate the destination IP address.

TTL: or time to leave is the value assigned in the TTL field which tells the data when to leave the
network.

Suppose there are two networks Network A and Network B with network space 9.5.4.0/24 and
125.5.45.0/24 respectively.

These two networks are connected to the same router with two network interfaces having IP
9.5.4.1(on network A) and 125.5.45.1(on network B).

Now suppose a laptop or desktop which is a client in this case which is a part of the Network A
having IP 9.5.4.23. Again, assume that a server which is connected to Network B having IP address
125.5.45.34 and have a web server which is listening on port 80.

Now our clients want to access a website whose IP address is 125.5.45.34. He opens any browser
and entered this IP address in the search bar and hits enter.

The browser then communicates with the local networking stack, which is the part OS responsible
for managing networking functions. Browser tells that it wants to establish a TCP connection with
the server 125.5.45.34 through port 80. Then networking stack will check its own subnet and finds
that 125.5.45.34 is on another network so the client has to send data through its gateway which
have the network interface of 9.5.4.1. Then the client checks its ARP table to find out what is the
MAC address of its gateway. There are two possibilities: It finds the MAC address. It doesn't find the
MAC address. If it didn't find first it will get in through an ARP request and then continue as
described below: Our client then makes an ARP request for IP 9.5.4.1 which is sent to all devices
connected to the same network having the same hardware broadcast ID of all Fs. When the router
on this network receives this request, it knows that it is for me and sends an ARP response with its
own MAC address to the client (9.5.4.23). Here our client gets the MAC to address of its gateway &
ready to send the outbound packet. The operating system opens an ephemeral port suppose 51355
and opens a socket connecting the browser through this port.

The networking stack starts to form TCP segment. It completes all the header field like source port
(51355) and destination port (80), sequence number filled, SYN flag is assigned to 1 and finally, the
checksum is calculated and filled in the corresponding checksum field.

This TCP segment is now given to the IP layer of the networking stack. Here IP header is filled with
source IP 9.5.4.23 and destination IP 125.5.45.34, Time to leave or TTL is set to 64. Now the earlier
formed TCP segment is put as payload for IP datagram. Then checksum is calculated and filled. Now
comes the turn of Ethernet frame all its field like source and destination MAC address are filled &
then IP datagram formed earlier is inserted as the payload of ethernet frame and checksum value is
calculated and filled.

Now it is ready to be sent to across the physical layer.It is sent through the wire connecting the
client and the switch. The switch receives it & it already knows where this MAc address is which
finally sends all the entire Ethernet frame to the router.

After this router does the following task:

1.Receives frame

2.Recognise address

3.Calculate checksum

4.Compare checksum

5.Match detected

Following these tasks, it then removes the Ethernet frame with the only datagram left & then
performs a checksum again to ensure the correctness of data. It then searches it Routing table and
finds the destination IP address 125.5.45.34 is connected via the local network. Now it decrements
the TTL field by one (now 63) calculate the new checksum and makes new IP datagram which is
again encapsulated by ethernet frame with destination and source MAC address filled which is finally
sent to the Network B where the switch identifies the destination mac address and send it to the
server. This is the complete process of one time connection with SYN field set to 1.This process is
again repeated from the server side with ACK (Acknowledgement) set to one. These processes
repeated again and again until the data is completely sent and a connection is closed.

You might also like