You are on page 1of 57

TCP/IP Model

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


The TCP/IP Reference Model

Protocols and networks in the TCP/IP model initially


By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
TCP/IP Protocol Architecture

Developed by the US Defense Advanced Research


Project Agency (DARPA) for its packet switched
network (ARPANET-Advanced Research Projects
Agency Network)
Used by the global Internet
No official model but a working one.
It consists of 5 layers
Application layer
Transport layer(host to host layer)
Internet layer(network layer)
Network access layer(data link layer)
Physical layer

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


OSI v TCP/IP

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


TCP/IP Protocol Architecture
Model

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


PHYSICAL LAYER
Physical layer
Physical interface between data transmission device
(e.g. computer) and transmission medium or network
Characteristics of transmission medium
Signal levels
Data rates

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


NETWORK ACCESS LAYER
Exchange of data between end system and the
network
Responsible to deliver frames reliably from hop to
hop
If within the LAN, upper layers can leave reliability
issues (error/flow control)
Guarantee Error Free Delivery of Data from one hop
to the other (not N/W to N/W OR not end-to-end)
This layer is divided into 2 sub layers
LLC
MAC

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


INTERNET LAYER
Systems may be attached to different networks
Lowest layer that deals with end-to-end transmission
Routing functions across multiple networks
Implemented in end systems and router
Guarantee Error Free Delivery of Packets from one N/W
to the other N/W (not end-to-end)
TCP/IP supports Internet Protocol (IP) - unreliable
protocol and a best-effort delivery service. [ no error
checking or tracking. ]
The data unit at the IP layer is called an IP datagram,
an independent packet that travels from the source to
the destination

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


TRANSPORT LAYER
Transport Layer
Reliable delivery of data end to end(process to
process)
Ordering of delivery
Offers connection oriented and connection less services
Reliability includes: Error detection and correction, flow
control, packet duplication etc
Runs only on host not on the network
Transmission Control Protocol (TCP) and User
Datagram Protocol (UDP).

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


APPLICATION LAYER
Provide interface between end-user &
applications
Support several users applications
For example: FTP, Telnet, SSH, SMTP
Communication on the Internet uses the client-
server model.
A client application program running on a local
machine requests a service from a server
application program running on a remote
machine.
[Note: The server program is always running, and
the client program runs only when needed. ]
By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
OSI v TCP/IP

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


TCP
Connection oriented
Temporary logical association between entities in different
systems
Includes source and destination port
Identify respective users (applications)
Connection refers to pair of ports

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


UDP
Alternative to TCP is User Datagram Protocol
Not guaranteed delivery
No preservation of sequence
No protection against duplication
Minimum overhead
Adds port addressing to IP

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


TCP/IP Concepts

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Trace of Simple Operation
Process associated with port 1 in host A sends
message to port 2 in host B
Process at A hands down message to TCP to
send to port 2
TCP hands down to IP to send to host B
IP hands down to network layer (e.g. Ethernet)
to send to router J
Generates a set of encapsulated PDUs

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Addressing level
Unique address for each end system (computer)
and router Physical address
Network level address
IP or internet address (TCP/IP)
Network service access point or NSAP (OSI)
Process within the system
Port number (TCP/IP)
Service access point or SAP (OSI)

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Some Protocols in TCP/IP Suite

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Client-server model

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Networking Protocol: TCP/IP

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


TCP/IP Protocol Suite
HTTP SMTP DNS RTP
Distributed
applications User
Reliable
TCP UDP
stream datagram
service service

Best-effort (ICMP, ARP)


IP
connectionless
packet transfer

Network Network Network


interface 1 interface 2 interface 3

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Diverse network technologies
Addressing
Three different levels of addresses are used in an internet using the TCP/IP
protocols: physical (link) address, logical (IP) address, and
port address.

Physical Address
Logical Address
Port Address

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Addresses in TCP/IP

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Relationship of layers and addresses in TCP/IP

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Physical Addresses
LANs (and other networks) assign physical addresses to the
physical attachment to the network
The network uses its own address to transfer packets or frames to
the appropriate destination
IP address needs to be resolved to physical address at each IP
network interface
Example: Ethernet uses 48-bit addresses
Each Ethernet network interface card (NIC) has globally unique
Medium Access Control (MAC) or physical address
First 24 bits identify NIC manufacturer; second 24 bits are serial
number
00:90:27:96:68:07 12 hex numbers

Intel

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
Internet Names & Addresses
Internet Names Internet Addresses
Each host a a unique name Each host has globally unique
Independent of physical logical 32 bit IP address
location Separate address for each
Facilitate memorization by physical connection to a network
humans Routing decision is done based
Domain Name on destination IP address
Organization under single IP address has two parts:
administrative unit
Host Name netid and hostid
Name given to host netid unique
computer netid facilitates routing
User Name Dotted Decimal Notation:
Name assigned to user int1.int2.int3.int4
(intj = jth octet)
leongarcia@comm.utoronto.ca
128.100.10.13
DNS resolves IP name to IP address

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


ExamplE 4

An Internet address (in IPv4) is 32 bits in length,


normally written as four decimal numbers, with each
number representing 1 byte. The numbers are separated
by a dot. Below is an example of such an address.

132.24.75.9
An internet address in IPv4 in decimal numbers

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


ExamplE 5

Figure shows an example of transport layer


communication. Data coming from the upperlayers
have port addresses j and k ( j is the address of the
sending process, and k is the address of the receiving
process). Since the data size is larger than the network
layer can handle, the data are split into two packets,
each packet retaining the service-point addresses ( j
and k). Then in the network layer, network addresses (A
and P) are added to each packet.

See Next Slide


By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
ExamplE 5 (Continued)

The packets can travel on different paths and arrive at


the destination either in order or out of order. The two
packets are delivered to the destination transport layer,
which is responsible for removing the network layer
headers and combining the two pieces of data for
delivery to the upper layers.

See Next Slide

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Port addresses

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


ExamplE 6

A port address is a 16-bit address represented by one


decimal number as shown below.

753
A 16-bit port address represented as one single number.

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


ExamplE 1

In Figure a node with physical address 10 sends a


frame to a node with physical address 87. The two
nodes are connected by a link. At the data link level this
frame contains physical (link) addresses in the header.
These are the only addresses needed. The rest of the
header contains other information needed at this level.
The trailer usually contains extra bits needed for error
detection.

See Next Slide

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Physical addresses

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


ExamplE 2

Most local area networks use a 48-bit (6 bytes) physical


address written as 12 hexadecimal digits, with every 2
bytes separated by a colon as shown below:

07:01:02:01:2C:4B
A 6-byte (12 hexadecimal digits) physical address.

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


ExamplE 3

In Figure we want to send data from a node with network


address A and physical address 10, located on one LAN, to a
node with a network address P and physical address 95, located
on another LAN. Because the two devices are located on
different networks, we cannot use link addresses only; the link
addresses have only local jurisdiction. What we need here are
universal addresses that can pass through the LAN boundaries.
The network (logical) addresses have this characteristic.

See Next Slide

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


ExamplE 3 (Continued)

The packet at the network layer contains the logical addresses,


which remain the same from the original source to the final
destination (A and P, respectively, in the figure). They will not
change when we go from network to network. However, the
physical addresses will change as the packet moves from one
network to another. The boxes labeled routers are
internetworking devices.

See Next Slide

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


IP addresses

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


IP Addressing

RFC 1166
Each host on Internet has unique 32 bit IP address
Each address has two parts: netid and hostid
netid unique & administered by
American Registry for Internet Numbers (ARIN)
Reseaux IP Europeens (RIPE)
Asia Pacific Network Information Centre (APNIC)
Facilitates routing
A separate address is required for each physical connection of a
host to a network; multi-homed hosts
Dotted-Decimal Notation:
int1.int2.int3.int4 where intj = integer value of jth octet
IP address of 10000000 10000111 01000100 00000101
is 128.135.68.5 in dotted-decimal notation

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Classful Addresses
Class A 7 bits 24 bits
0 netid hostid

126 networks with up to 16 million hosts 1.0.0.0 to


127.255.255.255

Class B
14 bits 16 bits
1 0 netid hostid

16,382 networks with up to 64,000 hosts 128.0.0.0 to


191.255.255.255

Class C 22 bits 8 bits


1 1 0 netid hostid

2 million networks with up to 254 hosts 192.0.0.0 to


223.255.255.255

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Class D 28 bits
1 1 1 0 multicast address
224.0.0.0 to
239.255.255.255
Class E Addresses
The first byte is 240 to 255 range.(the first five bits of the byte are
1,1,1,1, and 0).
These addresses are reserved for experimental use and potential
future addressing modes and used for broadcasts

Up to 250 million multicast groups at the same time


Permanent group addresses
All systems in LAN; All routers in LAN;
All OSPF routers on LAN; All designated OSPF routers on a LAN, etc.
Temporary groups addresses created as needed
Special multicast routers

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Reserved Host IDs (all 0s & 1s)
Internet address used to refer to network has hostid set to all 0s
this host
0 0 0 0 0 0 (used when
booting up)

a host
0 0 0 host in this
network

Broadcast address has hostid set to all 1s


broadcast on
1 1 1 1 1 1 local network

broadcast on
netid 1 1 1 1 1 1 1 distant
network
By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
Example 1

Change the following IP address from binary


notation to dotted-decimal notation.
10000001 00001011 00001011 11101111

Solution

129.11.11.239
By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
Example 2

Change the following IP address from


dotted-decimal notation to binary notation.
111.56.45.78

Solution
01101111 00111000 00101101 01001110

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Example 3

Find the error, if any, in the following IP


address:
111.56.045.78

Solution

There are no leading zeroes in


dotted-decimal notation (045).
By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
Example 3 (continued)

Find the error, if any, in the following IP


address:
75.45.301.14

Solution

In dotted-decimal notation, each number is


less than or equal to 255; 301 is outside
this range.
By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
Example 4

Change the following IP addresses from


binary notation to hexadecimal notation.
10000001 00001011 00001011 11101111

Solution

0X810B0BEF or 810B0BEF16

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Example internet
Server PC
Router
(2,1)
(1,1) s
PPP
(1,3) r (2,2)
Netid=2
w
Ethernet *PPP does not use addresses
(netid=1) Workstation

(1,2)

netid hostid Physical address

server 1 1 s
workstation 1 2 w
router 1 3 r
router 2 1 -
PC 2 2 -

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Encapsulation

IP
header IP Payload

Ethernet IP
IP Payload FCS
header header

Ethernet header contains:


source and destination physical addresses
network protocol type (e.g. IP)

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


IP packet from workstation to
server
Server PC
Router
(2,1)
(1,1) PPP
s (1,3) r (2,2)
w
Ethernet w, s (1,2), (1,1)

Workstation
(1,2)

1. IP packet has (1,2) IP address for source and (1,1) IP address for
destination
2. IP table at workstation indicates (1,1) connected to same network, so IP
packet is encapsulated in Ethernet frame with addresses w and s
3. Ethernet frame is broadcast by workstation NIC and captured by server
NIC
4. NIC examines protocol type field and then delivers packet to its IP layer

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


IP packet from server to PC
Server PC
Router
(2,1) (1,1), (2,2)
(1,1) s (1,3) r (2,2)
w
s, r (1,1), (2,2)

Workstation

(1,2)
1. IP packet has (1,1) and (2,2) as IP source and destination addresses
2. IP table at server indicates packet should be sent to router, so IP packet is
encapsulated in Ethernet frame with addresses s and r
3. Ethernet frame is broadcast by server NIC and captured by router NIC
4. NIC examines protocol type field and then delivers packet to its IP layer
5. IP layer examines IP packet destination address and determines IP packet
should be routed to (2,2)
6. Routers table indicates (2,2) is directly connected via PPP link
7. IP packet is encapsulated in PPP frame and delivered to PC
8. PPP at PC examines protocol type field and delivers packet to PC IP layer
By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
How the layers work together
(a) Server PC
Router
(2,1)
(1,1) s (1,3) r PPP
(2,2)
Ethernet
HTTP uses process-to-process
Reliable byte stream transfer of
TCP connection:
Server Server socket: (IP Address, 80)
(b) PC
PC socket (IP Address, Eph. #)
HTTP TCP uses node-to-node HTTP
Unreliable packet transfer of IP
TCP Server IP address & PC IP address TCP
IP IP IP
Network interface Network interface Network interface
Internet
Router
Ethernet PPP
By R VIJAYAN,Assistant Professor(SG),SITE,VIT University
Encapsulation
TCP Header contains
source & destination HTTP Request
port numbers

IP Header contains
source and destination TCP
IP addresses; header HTTP Request
transport protocol type

Ethernet Header contains


source & destination MAC IP TCP
header header HTTP Request
addresses;
network protocol type

Ethernet IP TCP
HTTP Request FCS
header header header

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


A Communications Model
Source
generates data to be transmitted
Transmitter
Converts data into transmittable signals
Transmission System
Carries data
Receiver
Converts received signal into data
Destination
Takes incoming data

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Communications Tasks

Transmission system utilization Addressing

Interfacing Routing

Signal generation Recovery

Synchronization Message formatting

Exchange management Security

Error detection and correction Network management

Flow control

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Simplified Communications Model - Diagram

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University


Simplified Data Communications
Model

By R VIJAYAN,Assistant Professor(SG),SITE,VIT University