You are on page 1of 54

Concept of Network and TCP/IP Model

Broadband Faculty
Advanced Level Telecom Training Centre (ALTTC)
Bharat Sanchar Nigam Limited (BSNL)
Agenda
• Internet
• Comparison of TCP/IP & OSI
• Data Encapsulation
• TCP-IP Protocol Suite
• TCP/IP Protocol Documents
• TCP-IP Protocol Suite (IPv4 vs IPv6)

Concept of Network and TCP/IP Model 2


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
Concept of Network and TCP/IP Model 3
TCP/IP and OSI
• OSI is made of seven layers.
• TCP/IP protocol is made of five layers.
APPLICATION
PRESENTATION APPLICATION
SESSION
OSI Model TRANSPORT TRANSPORT TCP/IP Model
NETWORK NETWORK
DATA LINK DATA LINK
PHYSICAL PHYSICAL

Concept of Network and TCP/IP Model 4


Data Encapsulation

Application Data

TPT Layer TCP Header Data


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

Concept of Network and TCP/IP Model 5


TCP/IP Protocol Suite..

FTP TFTP
A SMTP NFS
TELNET SNMP
HTTP DNS
T TCP UDP
N ICMP IGMP IP ARP RARP
D
Protocols defined by the underlying networks
P

Concept of Network and TCP/IP Model 6


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.
Concept of Network and TCP/IP Model 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 directories between hosts on the
network.
• Simple N/w Management Protocol (SNMP)
– Provides the ability to supply network management services on the
network.
• Domain Name Service (DNS)
– Provides mapping between domain name and IP address and vice
versa.
Concept of Network and TCP/IP Model 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
• TCP is a byte oriented protocol i.e. 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
Concept of Network and TCP/IP Model 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

U A P R S F
HELEN R C S S Y I WINDOW SIZE
G K H T N N

CHECKSUM URGENT POINTER

OPTIONS AND PADDING

Concept of Network and TCP/IP Model 10


TCP Header…
• Source & Destination Port (16 Bits)
– Can run number of applications using same transport by multiplexing through port
numbers
– Port numbers are used to identify a unique application in a machine
– 65536 (0-65535) port numbers can be defined
– Theoretically it is possible to run 65535 simultaneous applications in a host
– 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

Concept of Network and TCP/IP Model 11


Well known port numbers

PORT DESCRIPTION

20 File Transfer-Data

21 File Transfer-Control

23 Telnet

25 SMTP

53 Domain Name Server

69 Trivial File Transfer

80 WWW

123 Network Time Protocol

179 Border Gateway Protocol

Concept of Network and TCP/IP Model 12


TCP Header…
• Sequence Number (32 Bits)
– Helps in establishing TCP connections, along with SYN bit, called as Three Way
Handshake
– Helps in maintaining account of amount of data being transferred
– Identifies where the encapsulated data fits within a data stream from the
sender
– Sequence number is incremented, in the system, every 4 microsecond
• Acknowledgement Number (32 Bits)
– Helps in maintaining account of amount of data being transferred
– Identifies the sequence number expected from the other end of data
transmission unit

Concept of Network and TCP/IP Model 13


Seq/Ack numbers relation
• During TCP Connection Establishment / Three way
handshake
– Acknowledgement Number Sent = Sequence Number Received+1

• During Data Transfer


– Acknowledgement Number Sent = Sequence Number Received + Data
Received in Bytes

Concept of Network and TCP/IP Model 14


Three-Way-Handshake

Sender 0 1 Receiver
SN-95426
2 AN-00000 SN-16780 3
1 0 000B AN- 95427
1 1 000B
SN-95427
AN-16781
4 0 1 000B

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

Concept of Network and TCP/IP Model 15


Data Transfer
0 SN-95426 1
Sender AN-00000 SN-16780 Receiver
2 1 0 000B AN- 95427
3
1 1 000B
SN-95427
4 AN-16781 SN-16781
5
0 1 000B AN- 95428
0 1 100B
SN-95428
5 AN-16881 SN-16881
0 1 200B AN- 95628 5
0 1 150B
SN-95628
5 AN-17031 SN-17031
0 1 250B AN- 95878 5
0 1 300B
0-Closed; 1-Listen; 2-SYN-Sent; 3-SYN-Received; 4-Established; 5-Data Transfer
Concept of Network and TCP/IP Model 16
Closing a TCP Connection

SN - 95880
Sender 6 AN -17334
Receiver
0 1 1 0B SN - 17334
AN - 95881
0 1 0 0B

WAIT
SN - 17334
AN - 95881 6
SN - 95881 0 1 1 0B
AN -17334
0 1 0 0B
0 0
6-Finish; 0- Closed

Concept of Network and TCP/IP Model 17


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)

Concept of Network and TCP/IP Model 18


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
Concept of Network and TCP/IP Model 19
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

Concept of Network and TCP/IP Model 20


Sliding Window-Flow Control
Moves to right when
ack is received. Sent and ack
Moves to right when Sent but not ack
data is sent. Can be sent
Moves to right or left to fix Can’t be sent
the size of the window.

Window Size

Concept of Network and TCP/IP Model 21


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

Concept of Network and TCP/IP Model 22


TCP Header……
• Padding
– Consists of 1-3 octets, each equal to zero, to force
the length of TCP header to be in multiples of four
octets.

Concept of Network and TCP/IP Model 23


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

Concept of Network and TCP/IP Model 24


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 DESTINATION PORT
MESSAGE LENGTH CHECKSUM

Concept of Network and TCP/IP Model 25


UDP Header...
• Source Port (16 Bits)
– Identifies the sending process.
• Destination Port (16 Bits)
– Identifies the receiving process.
– Some fixed, pre-assigned port numbers used for services on the Internet.
• 7 for UDP; 69 for TFTP
• Message length (16 Bits)
– Indicates the size of the UDP header and its data in bytes.
– Minimum size is 8, if carries no data.
• Checksum (16 Bits)
– Covers the UDP header and UDP data.
– Optional; If not used, set to all zeros.

Concept of Network and TCP/IP Model 26


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.
Concept of Network and TCP/IP Model 27
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 TOTAL LENGTH

IDENTIFICATION D M FRAGMENT OFFSET


F F

TIME TO LIVE PROTOCOL HEADER CHECKSUM

SOURCE ADDRESS OF HOST

DESTINATION ADDRESS OF HOST

OPTIONS PADDING

Concept of Network and TCP/IP Model 28


IP Header…
• Version (4 Bits)
– Identifies the IP version to which the packet belongs
• Header Length (4 Bits)
– Indicates the length of IP header in 32 bit words.
– Minimum length is 20 octets.
– Options may increase the size up to a maximum of 24 octets.
• Type of Service (8 Bits)
– Used for specifying special handling of packet.
– Has two sub-fields:
• Precedence
• TOS

Concept of Network and TCP/IP Model 29


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

Precedence Delay Reliability


000-Routine 0-Normal 0-Normal
001-Priority 1-Minimise 1-Maximise
010-Immediate
011-Flash
Throughput Cost
100-Flash Override
0-Normal 0-Normal
101-CRITIC/ECP
1-Maximise 1-Minimise
110-Internetwork Control
111-Network Control
0 0 0 0 0 0 0 0 = No TOS

Concept of Network and TCP/IP Model 30


IP Header…..
• Total Length (16 Bits)
– Specifies total length of the packet, including header, in octets
– Largest decimal number =216= 65535, the maximum possible
size of an IP packet is 65535 octets
– Total length - header length = Packet’s data payload
• Identification (16 Bits)
– Each datagram is identified by a identification number set by the
source.
– Normally incremented by 1 for each datagram sent.

Concept of Network and TCP/IP Model 31


IP Header……
• Flags (3 Bits)
– First bit is not used.
– Second bit is Don’t Fragment (DF) bit
– Third bit if 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

Concept of Network and TCP/IP Model 32


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

Concept of Network and TCP/IP Model 33


Fragmentation..
MTU-1500 MTU-1500
172.16.2.0 MTU-576 172.16.3.0

1500 B
IP TCP Data
512 B 512 B 476 B
IP IP TCP Data IP Data IP Data
DF=0; MF=1; Offset=0 DF=0; MF=1; Offset=64 DF=0; MF=0; Offset=128

IP TCP Data Data Data

IP TCP Data
Concept of Network and TCP/IP Model 34
Fragmentation
• Only the receiver host reassembles the datagram
• The destination machine starts a reassembly timer for
about 60-120 seconds.
• If not all fragments were received, then hosts discard
the packets and sends a time exceeded ICMP message
to the source machine
• If a single fragment is lost during a transmission, the
entire packet must be resent
Concept of Network and TCP/IP Model 35
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
Concept of Network and TCP/IP Model 36
IP Header…….
• Source Address of Host (32 Bits)
– IP Address of the Originating Machine
• Destination Address of Host (32 Bits)
– IP Address of the Destination Machine
• 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

Concept of Network and TCP/IP Model 37


IP Header……..
– Record Route:
• Makes each router to append its IP address.
– Time Stamp:
• Makes each router to append its IP address and time
stamp.
• Padding
– Ensures that the header ends on a 32 bit boundary
by adding zeros after the option field.
Concept of Network and TCP/IP Model 38
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

Concept of Network and TCP/IP Model 39


Socket Connection..
• Ports along with an IP address, known as socket
connection, allow any application in any machine on
an internet to be uniquely defined.
• Multiple applications can run simultaneously on a
host by making use of separate socket connection for
each application.

Concept of Network and TCP/IP Model 40


Socket Connection-Multiplexing

A.B.C.D E.F.G.H

FTP DNS FTP DNS


DATA
2764 3753 21 53
DATA

TCP UDP T DATA 3753-53


TCP UDP
DATA 2764-21
IP N
DATA 3753-53 A.B.C.D-E.F.G.H
D
DATA 2764-21 A.B.C.D-E.F.G.H
P TRAILER DATA 3753-53 A.B.C.D-E.F.G.H HEADER

TRAILER DATA 2764-21 A.B.C.D-E.F.G.H HEADER

1. A.B.C.D(2764) – E.F.G.H(21) 2. A.B.C.D(3753) – E.F.G.H(53)


Concept of Network and TCP/IP Model 41
Socket Connection-Demultiplexing

A.B.C.D E.F.G.H

FTP DNS DATA FTP DNS


2764 3753 DATA 21 53
DATA 53- 3753
TCP UDP T TCP UDP
DATA 21- 2764

IP N DATA 53- 3753 E.F.G.H-A.B.C.D

DATA 21- 2764 E.F.G.H-A.B.C.D


D
TRAILER DATA 53- 3753 E.F.G.H-A.B.C.D HEADER
P
TRAILER DATA 21- 2764 E.F.G.H-A.B.C.D HEADER

1. A.B.C.D(2764) – E.F.G.H(21) 2. A.B.C.D(3753) – E.F.G.H(53)


Concept of Network and TCP/IP Model 42
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.
Concept of Network and TCP/IP Model 43
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
6-Destination network unknown
Concept of Network and TCP/IP Model 44
Internet Control Message Protocol
7-Destination host unknown
8-Source host isolated
9-Communication with destination network administratively prohibited
10-Communication with destination host administratively prohibited
11-Network unreachable for type of service
12-Host unreachable for type of service
– Time exceeded message format
• 0-TTL exceeded
• 1-Fragment reassembly time exceeded

Concept of Network and TCP/IP Model 45


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.

Concept of Network and TCP/IP Model 46


Address Resolution Protocol
• Address Resolution Protocol is used to translate 32
bits IP addresses to 48 bits Ethernet addresses.
• A host’s 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.

Concept of Network and TCP/IP Model 47


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 Request Request That’s


Response Ignored Ignored Me
Accepted 129.1.1.2 129.1.1.3 08-00-10-99-AC-54
08-00-39-00-2F-AB
08-00-39-00-2F-C3 08-00-5A-21-A7-22

Concept of Network and TCP/IP Model 48


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 RARP-Request to
find its IP Address at the time of boot up.

Concept of Network and TCP/IP Model 49


RARP Operation

Give me my IP address RARP Response

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

Concept of Network and TCP/IP Model 50


IPv4 vs IPv6
• Some independent protocols of version 4 are part of
ICMPv6.
– RARP protocol is dropped from the suite.
– ARP and IGMP are combined with ICMPv6.
ICMP IGMP
IPv4
ARP RARP

ICMP
IPv6

Concept of Network and TCP/IP Model 51


IPv6 Base 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 PRI FLOW LABEL
PAYLOAD LENGTH NEXT HEADER HOP LIMIT

SOURCE ADDRESS
(128 Bits)

DESTINATION ADDRESS
(128 Bits)

PAYLOAD (0-65535 Bytes)


(EXTENSION HEADERS + DATA PACKETS FROM UPPER LAYERS)

Concept of Network and TCP/IP Model 52


TCP/IP Protocol Documents
• TCP/IP technical documents are known as Request For
Comments (RFCs).
• Once issued, RFC do not change.
– Updated by new RFCs.
– RFCs can be obsoleted but their numbers are never
used again.
• A major source for RFCs is the Internet Engineering Task
Force and are accessible on site www.ietf.org
Concept of Network and TCP/IP Model 53
Concept of Network and TCP/IP Model 54

You might also like