You are on page 1of 38

TCP/IP Protocol Suite

Arun Aggarwal
GM ( NW) Tel: +91-120-2728294(O) +91-120-2728410(R) E-Mail: arun_aggarwal@bsnl.in
1

Objectives
What is Internet? TCP/IP Layers Data Encapsulation TCP-IP Protocol Suite

What is Internet?
Internet is network of networks, with different hardware/software technologies Also known by the name TCP/IP Internet Name TCP/IP is taken from the names of the one of the transport layer protocols (Transport Control Protocol) and the network layer protocol (Internet Protocol) TCP/IP is backbone of the Internet

TCP/IP and OSI


OSI is made of seven layers. TCP/IP protocol is made of five layers.
APPLICATION PRESENTATION SESSION APPLICATION

OSI Model

TRANSPORT NETWORK DATA LINK PHYSICAL

TRANSPORT NETWORK DATA LINK PHYSICAL

TCP/IP Model

Data Encapsulation
Application Data

TPT Layer

TCP Header UDP Header

Data Data

TCP Segment

UDP Message NW Layer IP Header TCP-UDP IP Datagram Data Link Frame Head IP Header TCP-UDP Frame Data Trailer Data

TCP/IP Protocol Suite..


FTP SMTP TELNET HTTP TCP ICMP IGMP IP UDP ARP RARP TFTP NFS SNMP DNS

T N D P

Protocols defined by the underlying networks

Applications using TCP


File Transfer Protocol (FTP)
Provides the ability to upload and download files between hosts on the network.

Simple Mail Transport Protocol (SMTP)


Provides the ability to send mail between users on the network.

TELNET
Provides the ability to login into a remote host and administer the machine.

Hyper Text Transfer Protocol (HTTP)


Provides the ability to supply web pages between a browser and the server.
7

Applications using UDP


Trivial File Transfer Protocol (TFTP)
Provides simplex file transfer for network booting of devices.

Network File System (NFS)


Provides the ability for sharing between hosts on the network. Provides the ability to supply management services on the network. directories

Simple N/w Management Protocol (SNMP)


network

Domain Name Service (DNS)


Provides mapping between domain name and IP address and vice versa.
8

TCP Details
Provides application programs access to the network using a reliable connection-oriented transport layer service TCP sends and receives data reliably using sequence numbers and acknowledgements Every byte in each packet is assigned a sequence number Data stream handed over to TCP is called an unstructured stream TCP divides this data stream into segments for transmission to remote network
9

TCP Header..
Octet +0 Octet +1 Octet +2 Octet +3 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

SOURCE PORT

DESTINATION PORT

SEQUENCE NUMBER ACKNOWLEDGEMENT NUMBER HELEN UA P R S F R C S S Y I GK HT NN CHECKSUM WINDOW SIZE URGENT POINTER

OPTIONS AND PADDING

10

TCP Header
Source & Destination Port (16 Bits)
Can run number of applications using same transport by multiplexing through port numbers Port numbers (0-65535) are used to identify a unique application in a machine The first 1024 ports, port numbers 0-1023 known as well known port numbers, are assigned and are reserved for standard applications and are controlled by IANA The remaining ports, 1024-65535, are dynamic and can be used freely by applications Source port is randomly generated by the source machine
11

Well known port numbers


PORT 20 21 23 25 53 69 80 123 179 DESCRIPTION File Transfer-Data File Transfer-Control Telnet SMTP Domain Name Server Trivial File Transfer WWW Network Time Protocol Border Gateway Protocol
12

TCP Header
Sequence Number & Acknowledgement Number (32 Bits each) Helps in establishing TCP connections, along with SYN bit, called as Three Way Handshake Helps in maintaining account of amount of data being transferred Sequence number is incremented, in the system, every 4 microsecond Acknowledgement Number identifies the sequence number expected from the other end of data transmission unit

13

Seq/Ack numbers relation


During TCP Connection Three way handshake During Data Transfer
Acknowledgement Number Sent = Sequence Number Received + Data Received in Bytes

Establishment/

Acknowledgement Number Sent = Sequence Number Received+1

14

Three-Way-Handshake
Sender 0
SN-95426

Receiver

AN-00000 1 0 000B SN-95427

SN-16780 AN- 95427 1 1 000B

AN-16781 0 1 000B Ack. Flag

Syn. Flag

0) Closed; 1) Listen; 2) SYN-Sent; 3) SYN-Received; 4) Link Established

15

TCP Header.
Header Length (4 Bits)
Sometimes called Data Offset Indicates the length of header in 32-bit words Identifies the beginning of data Typical value is 5 unless there are options

Flags (6 Bits)
Urgent (URG) Acknowledgement (ACK) Push (PSH) Reset (RST) Synchronisation (SYN) Finish (FIN)
16

TCP Header..
Window Size (16 Bits)
Indicates the size of the sliding window Specifies the number of octets, starting with the octet indicated by the acknowledgement number, that the sender of the segment will accept from its peer at the other end of the connection before the peer must stop transmitting and wait for an acknowledgement A default window size is 4096 bytes Used for flow control by using Sliding window mechanism

17

Flow Control
Sender retains a copy of transmitted data until it receives an acknowledgment from the remote network. If no acknowledgment is received, within a specified time, the data is retransmitted by using adaptive retransmission algorithm.
TCP records the time of the transmission and sequence number of the segment. TCP again records the time of the acknowledgement received. Using this delta, TCP builds a sample round-trip delay time and uses this to build an average time for a packet to be sent and to receive an acknowledgement

TCP will time out after a number of unsuccessful retransmissions


18

TCP Header..
Checksum(16 Bits)
Used for error detection Covers both header and the encapsulated data

Urgent Pointer(16 Bits)


Used only when urgent flag is set Points to the last octet of urgent data

Options
One of the important options is MSS (Maximum Segment Size) Informs the receiver of the largest segment the sender is willing to accept, without causing fragmentation
19

User Datagram Protocol


Provides unreliable connectionless service Transfers data without establishing a session Used for services that have an inbuilt reliability Does not use end to end error checking and correction Does not order the packets; may loose or duplicate a packet Runs faster than TCP due to less overheads
20

UDP Header..
Octet +0 Octet +1 Octet +2 Octet +3 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 SOURCE PORT MESSAGE LENGTH DESTINATION PORT CHECKSUM

Source Port & Destination Port


Same as in TCP

Message length (16 Bits)


Indicates the size of the UDP header and its data in bytes.

Checksum (16 Bits)


Covers the UDP header and UDP data.
21

Internet Protocol.
Provides best-effort or connectionless delivery service. No error checking or tracking If reliability is important, IP must be paired with a reliable protocol like TCP Transmits blocks of data called datagrams each of which is transported separately Responsible for IP addressing Datagrams may travel along different routes and may arrive out of sequence or duplicated.
22

IP Header..
Octet +0 Octet +1 Octet +2 Octet +3 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

VER

HLEN

TOS D M F F

TOTAL LENGTH FRAGMENT OFFSET HEADER CHECKSUM

IDENTIFICATION TIME TO LIVE PROTOCOL

SOURCE ADDRESS OF HOST

DESTINATION ADDRESS OF HOST

OPTIONS

PADDING

23

IP Header
Version (4 Bits)
Identifies the IP version of the packet

Type of Service (8 Bits)


Used for specifying special handling of packet. Has two sub-fields:Precedence & TOS

Total Length (16 Bits)


Specifies total length of the packet, including header, in octets Maximum possible size of an IP packet is 65535 octets
24

IP Header.
P P P D T R C 0 Reserved: Always set to 0

Precedence 000-Routine 001-Priority 010-Immediate 011-Flash 100-Flash Override 101-CRITIC/ECP 110-Internetwork Control 111-Network Control

Delay 0-Normal 1-Minimise

Reliability 0-Normal 1-Maximise

Throughput 0-Normal 1-Maximise

Cost 0-Normal 1-Minimise

= No TOS

25

IP Header
Identification (16 Bits)
Each datagram is identified by a identification number set by the source.

Flags (3 Bits)
First bit is not used. Second bit is Dont Fragment (DF) bit Third bit is More Fragment (MF) bit

Maximum Transmit Unit (MTU) is the size of the largest packet, including IP Header, that can be transmitted or received through a data link Default MTU is 576 bytes, which can be handled by any network without fragmentation
26

IP Header
Fragment Offset (13 Bits)
The fragmentation occurs at the routers, if the original packet length exceeds the MTU of a data link Used only in the cases when a datagram is fragmented on its way Specifies the offset, in units of eight octets, from the beginning of header to the beginning of the fragment Each fragment is marked, by router, with the same identifier number

27

IP Header
Time to live-TTL (8 Bits)
Assigns a life to an IP datagram

Protocol (8 Bits)
Specifies the protocol that runs on the top of IP. TCP-6; EGP-8; UDP-17; OSPF-89

Header Checksum (16 Bits)


Error detection field for IP header As each router decrements the TTL, the checksum is calculated by each router

Source Address of Host (32 Bits)


IP Address of the Originating Machine

Destination Address of Host (32 Bits)


IP Address of the Destination Machine
28

IP Header.
Options
Security: Specifies how secret the datagram is Strict Source Routing(SSR): Gives the complete path to be followed Loose Source Routing(LSR): Gives the list of routers not to be missed Record Route: Makes each router to append its IP address. Time Stamp: Makes each router to append its IP address and time stamp

29

Underlying Networks Protocols


Ethernet Token Ring FDDI
Fiber Distributed Data Interface

HDLC
High-level Data Link Control

Frame Relay PPP


Point-to-Point Protocol

ATM
Asynchronous Transfer Mode
30

Internet Control Message Protocol


Internet Control Message Protocol is a mechanism used by hosts and routers to send notification of datagram problems back to the sender. Sends error messages only to the source and not to intermediate routers. Sole function is to report problems, not to correct them. An important use of ICMP is echo/reply to test whether a destination is reachable and responding.
31

Internet Control Message Protocol


Echo request/reply (PING; Packet INternet Gropher)
Destination unreachable 0-Network unreachable 1-Host unreachable 2-Protocol unreachable 3-Port unreachable 4-Fragment needed but DF bit is set 5-Source route failed Time exceeded message format 0-TTL exceeded 1-Fragment reassembly time exceeded
32

Internet Group Message Protocol


Internet Group Message Protocol provides allows for multicast to operate on an internetwork.
Multicast is one-to-many communication. A message sent can be simultaneously received by a group of hosts.

Special type of Class-D IP addresses, starting with 1110, are reserved as multicast addresses.

33

Address Resolution Protocol


Address Resolution Protocol is used to translate 32 bits IP addresses to 48 bits Ethernet addresses. A hosts physical address is determined by broadcasting its IP address to all machines. The machine with matching IP address, in broadcast message, sends its hardware address to the machine originating broadcast.

34

ARP Operation
Give me MAC address of 129.1.1.4 Here is my MAC address

129.1.1.1

129.1.1.4

ARP Response Accepted

Request Ignored

Request Ignored 129.1.1.3 08-00-5A-21-A7-22

Thats Me 08-00-10-99-AC-54

129.1.1.2 08-00-39-00-2F-AB 08-00-39-00-2F-C3

35

Reverse Address Resolution Protocol


Reverse Address Resolution Protocol is used to get the 32 bits Source IP address, knowing the 48 bits Hardware address. It is reverse of ARP, hence named Reverse Address Resolution Protocol. A diskless workstation broadcasts RARPRequest to find its IP Address at the time of boot up.

36

RARP Operation
Give me my IP address RARP Response

Diskless work station

RARP Server

08-00-39-00-2F-AB 223.1.2.3 223.1.2.1 08-00-39-00-2F-C3 223.1.2.2 08-00-10-99-AC-54 08-00-5A-21-A7-22

37

38

You might also like