TCP/IP Model Four Layers Expalined

tcp-ip-model
We know that how the layered architecture helps the data transmission through the network. We now know how the OSI (Open System Interconnection) model. Second layered networking framework is DoD (Department of Defence) model which was developed by Defence Advance Research Project Agency (DARPA).
It is known as Internet Protocol Suite means this conceptual framework communication protocol used on Internet. It is mostly called by TCP/IP model because TCP (Transmission Control Protocol) and IP (Internet Protocol) were the important protocols used by DoD model. TCP/IP consists of layers such as Network Interface, Internet, Transport and Application Layer.

Now we can deeply look inside each TCP/IP Layers
tcp-ip-osi-comparison

Network Interface Layer of TCP/IP

Network Interface Layer (Network Access Layer) corresponds to the Physical and data link layer of the OSI model. Network access layer can do all the function that done by physical and data link layer such as using wiring standards, physical addressing, and synchronizing.

Internet Layer of TCP/IP

Internet layer maps to the network layer of the OSI model. TCP/IP is mainly focused on Internet Protocol (IP) were as OSI can have IP, IPX and AppleTalk.

IPv4 Header

DoD originally developed IP and now we are using IPv4 and IPv6, IPv4 is about 32 bit wide.IPv4 header is comprised of 13 fields in which 12 fields are required and one field is optional.  
ipv4-header-format

IPv4 Header Field Size in bits Description
Version
4
Used to describe the version IP;0100 in version means IPv4
Header Length
4
This field specifies header length minimum 160 bits
Type of Service
8
Used as QoS marking. Also known as Differentiated Service Code Point (DSCP) used to give more priority to certain packets
Total Length
16
Grant total of IP packet size measured in bytes. Range from 20 to 65535 bytes.
Identification
16
Used to identify fragment that belong to same packet. All fragments from one packet have same Identification number.
IP Flags
3
Used as Flag for segmentation
Fragment Offset
13
Fragment Offset allows the destination host to reassemble the
Fragments in the proper order.
Time To Live
8
Limits the lifespan of packet, its value is decremented as it passes through router; Helps to reduce routing loops.
Protocol
8
Used to identify which upper layer protocol is used.
Header Checksum
16
Used to check errors.
Source Address
32
Sender IPv4 address
Destination Address
32
Receiver IPv4 address
IP Optional Field
32
Optional field have various parameters.

TCP/IP Transport Layer

Transport layer of TCP/IP maps to the layer 4 of the OSI layer. This layer encompasses of two protocols TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) which are connection-oriented and connectionless protocols respectively.

TCP Header Format

tcp-header-format
TCP is one of the protocols used by DoD model. TCP is a Connection-Oriented protocol so it can provide reliable end-to-end communication. It can do functions such as segmentation, sequencing, acknowledgments and flow control.

TCP Header Field Size in bits Description
Source Port
16
Specify the TCP port number used by the sender
Destination Port
16
Specify the TCP Port used in the Destination
Sequence Number
32
Sequence Number (SYN) used to send segments which have this SYN to ensure that all segments is transmitted it use SYN
Acknowledgment Number
32
ACK is used by receiver; it means that segment up that is received and ready for next segment. If ACK5 means it received segments up to 5. Now ready for segment 5.
Offset
4
Used to indicate where the data begins.
Reserved
6
Reserved for future use. Must be zero.
TCP Flags
6
Also known as control bit used. To control transmission through TCP.
Window
16
Indicate window size in bytes that means amount of data that can be transmitted without receiving ACK
Checksum
16
Used to check errors in header and data.
Urgent Pointer
16
Communicate with current value of urgent pointer as an offset from the sequence number in the segment.
TCP Options
32
TCP option or some parameters to control the data transmission.

UDP Header Format

UDP is a lightweight protocol which is connectionless and unreliable. UDP has little overhead because don’t have to segment and sequence the data and not need to setup virtual circuit for data transmission. We don’t have to wait for acknowledgments from the receiver so UDP is very fast compared to TCP. And this is mainly used in steaming audio and video.
udp-header-format

UDP Header Fields Size in bytes Description
Source Port
16
Port number of the sender
Destination Port
16
Port address to the packet is addressed to.
UDP Length
16
UDP header and data length in bytes.
UDP Checksum
16
An optional field used for checking error. Not optional at IPv6 traffic.

TCP UDP Comparison

TCP UDP
Connection-Oriented Connectionless
Setup Virtual Circuit Don’t need virtual circuits
Reliable Unreliable
Acknowledgement No acknowledgement
Segmentation No Segmentation
Sequencing No sequencing
Flow Control No flow control

TCP/IP Application Layer

The main difference between OSI and TCP/IP model is that it have a single application layer, it can perform all things done by application, presentation and session layers of OSI model. This reduces complexity of developer and network administrator in classifying protocol.

TCP/IP Protocols

Now we are going to look some important protocols used in networks. We can manage user traffic to access multiple services of a server by assigning different port numbers to each request. We are also going to look some well-known (1-1023) port numbers also. Clients initiating the connection normally uses source port higher than 1023 such ports is known as Ephemeral Ports.

Protocol Description TCP Ports UDP ports
HTTP Hypertext Transfer Protocol used to retrieve contents of a web page 80
HTTPS Hypertext Transfer Protocol Secure used to retrieve contents of a web page securely 443
Telnet Used to connect remote host 23
DNS Domain Name Server used to resolve IP address of a domain 53 53
FTP File Transfer Protocol used to retrieve file from server 21
SSH Secure Shell used to connect remote site securely 22
TFTP Trivial File Transfer Protocol used to share file with remote host 69
SMTP Simple Mail Transfer Protocol used to send mail to server 25
DHCP Dynamic Host Configuration Protocol used to allocate dynamic IP address and details to devices on the network. 67
NTP Network Time Protocol used to synchronize clock in a device on the network 123
SNTP Simple Network Time Protocol a less accurate version of NTP 123
POP3 Post Office Protocol version 3 used to retrieve mail from server 110
LDAP Lightweight Directory Access Protocol used to access directories on the network 389
IMAP4 Internet message Access Protocol version 4 used to retrieve mail from the server 143
RDP Remote Desktop Protocol developed by Microsoft in order to control desktop of remote host 3389
RTSP Real Time Streaming Protocol used to stream videos and audios from media servers 554 554

Previous
Next Post »