SlideShare une entreprise Scribd logo
1  sur  45
Transmission Control Protocol
TCP/IP
Harshit Srivastava
Department of Communication System
Fall Semester 2012
Roll No. CDS12M001
Introduction and Special Techniques
2
TCP/IPTCP/IP
FTP, SMTP, Telnet,
HTTP,…
TCP, UDP
IP, ARP
Network Interface
3
A. What is TCP/IP?
• TCP/IP is a set of protocols developed to allow
cooperating computers to share resources across a
network
• TCP stands for “Transmission Control Protocol”
• IP stands for “Internet Protocol”
• They are Transport layer and Network layer
protocols respectively of the protocol suite
• The most well known network that adopted
TCP/IP is Internet – the biggest WAN in the world
TCP/IP
4
• A protocol is a collection of rules and procedures
for two computers to exchange information
• Protocol also defines the format of data that is
being exchanged
What is a protocol?
TCP/IP
5
Why TCP/IP is so popular?
• TCP/IP was developed very early
• Technologies were widely discussed and circulated
in documents called “Request for Comments”
(RFC) – free of charge
• Supported by UNIX operating system
TCP/IP
6
TCP/IP Model
• Because TCP/IP was developed earlier than the
OSI 7-layer mode, it does not have 7 layers but
only 4 layers
OSI 7-layerTCP/IP Protocol Suite
FTP, SMTP, Telnet,
HTTP,…
TCP, UDP
IP, ARP, ICMP
Network Interface
TCP/IP
7
• Application layer protocols define the rules when
implementing specific network applications
• Rely on the underlying layers to provide accurate
and efficient data delivery
• Typical protocols:
• FTP – File Transfer Protocol
• For file transfer
• Telnet – Remote terminal protocol
• For remote login on any other computer on the
network
• SMTP – Simple Mail Transfer Protocol
• For mail transfer
• HTTP – Hypertext Transfer Protocol
• For Web browsing
TCP/IP
8
• TCP/IP is built on “connectionless” technology,
each datagram finds its own way to its destination
• Transport Layer protocols define the rules of
• Dividing a chunk of data into segments
• Reassemble segments into the original chunk
• Typical protocols:
• TCP – Transmission Control Protocol
• Provide further the functions such as reordering
and data resend
• UDP – User Datagram Service
• Use when the message to be sent fit exactly into a
datagram
• Use also when a more simplified data format is
required
TCP/IP
9
• Network layer protocols define the rules of how to
find the routes for a packet to the destination
• It only gives best effort delivery. Packets can be
delayed, corrupted, lost, duplicated, out-of-order
• Typical protocols:
• IP – Internet Protocol
• Provide packet delivery
• ARP – Address Resolution Protocol
• Define the procedures of network address / MAC
address translation
• ICMP – Internet Control Message Protocol
• Define the procedures of error message transfer
TCP/IP
10
Application Layer
Application
Transport
Network
Network Interface
TCP/IP
11
SMTP
TCP
IP, ARP, ICMP
Network Interface
SMTP
TCP
IP, ARP, ICMP
Network Interface
SMTP ServerClient
Actual
Virtual
B. Example: SMTP
TCP/IP
12
• The underlying layers have guaranteed accurate
data delivery
• We need to make a lot agreements with the server
in application layer before sending mail
1. Agree on how data is represented
• Binary or ASCII
2. Ensure the right recipient
• There may be 1000 users served by the server
3. Ensure the client has the right to send mail
• Some clients are not welcome
4. How to tell the server it is the end of the message
• All mail looks the same
:
TCP/IP
13
• Example: SMTP
The following mail is to be sent:
Date: Fri, 18 Jan 02 13:26:31 IST
From: harshxtime@iiitdm.in
To: cds12m001@iiitdm.in
Subject: meeting
Let’s get together Monday at 1pm.
TCP/IP
14
SMTP ServerClient
access port 25 of server
HELO iiitdm.in
MAIL From:
<cds12m001@iiitdm.ac.in>
220 cds.iiitdm.ac SMTP Service
at 20 Jan 02 05:17:18 EDT
250 cds.iiitdm.ac – Hello,
iitdm.in
250 MAIL accepted
TCP/IP
15
Client SMTP Server
Date: Fri, 18 Jan 02 13:26:31 EDT
From: harshxtime@iiitdm.in
To: cds12m001@iiitdm.in
Subject: meeting
Let’s get together Monday at 1pm.
.
RCPT To:<harshxtime@iiitdm.in>
DATA
250 Recipient accepted
354 Start mail input;
end with .
TCP/IP
16
• The agreement made in the SMTP protocol
• All messages use normal text
• All ASCII characters
• The responses all begin with numbers
• To indicate the status when receiving the command
• Some words are reserved words
• HELO, MAIL, RCPT…
• Mail ends with a line that contains only a period
• The information passed with the SMTP messages
• The recipient name
• The sender name
• The mail
TCP/IP
17
C. Domain Name (mentioned before)
• Every computer has a network address
• e.g. 158.132.161.99
• To access a computer, we need to specify its
network address
• Human beings are weak in memorizing numbers
• We prefer computer name or domain name
• e.g. hkpu10.iiitdm.ac.in
• Need a machine on the Internet to convert name to
number
TCP/IP
18
Client
Domain Name Server
(DNS) of
XXXX.ac.in
Address of
www.yahoo.com
Where is
www.yahoo.co
m?usually UDP
DNS of com
DNS of Yahoo.com
Where is
www.yahoo.co
m?
Address of
www.Yahoo.com
Where is
yahoo.com? Address of the
DNS of
Yahoo.com
Become
client
TCP/IP
19
• Nevertheless, such a complicated procedure needs
not perform in most cases
• Client computers usually remember the answers
that it got before
• It reduces the loading to the root DNS
• To further reduce loading, there can be many root
DNS on the Internet
• e.g. there are a few “com” root DNS
TCP/IP
20
Transport Layer
Application
Transport
Network
Network Interface
Message
Segments
h M h M h M
TCP/IP
21
D. TCP and UDP
• TCP is a connection-oriented protocol
• Does not mean it has a physical connection between
sender and receiver
• TCP provides the function to allow a connection
virtually exists – also called virtual circuit
• TCP provides the functions:
• Dividing a chunk of data into segments
• Reassembly segments into the original chunk
• Provide further the functions such as reordering and
data resend
• Offering a reliable byte-stream delivery service
TCP – Transmission Control Protocol
TCP/IP
22
1 2 3
Sender
Timeout
retransmit
A1 A3
1 3
Recipient
2
A2
TCP/IP
23
• A Typical Procedure
• Sender
• TCP divides a message into segments
• Add sequence no.
• Send the segments in sequence and wait for
acknowledgement
• If an acknowledgement for a segment is not received
for a certain period of time, resend it until an
acknowledgement is received
• Recipient
• When receiving segments, send the
acknowledgement with correct number
• Reassembly the segments back to the message
TCP/IP
24
• A computer may perform a number of network
applications at the same time
• FTP + SMTP + HTTP, etc.
• Each computer has only one network address, how
can it serve so many applications at the same time?
Port Multiplexing
⇒ by port multiplexing
Network add:
158.132.161.99
Port 21 Port 25
Port 80
FTP SMTP
HTTP
TCP/IP
25
Well-known Port Numbers
• Some port numbers are reserved for some
purposes
• Port 21: FTP – file transfer
• Port 25: SMTP – mail transfer
• Port 23: TELNET – remote login
• Port 80: HTTP – Web access
• These port numbers are well known to all
computers in the network
• E.g. whenever a client access port 25 of the server,
it means the client needs SMTP service
TCP/IP
26
Client SMTP Server
Located by: network
address + TCP port
no.
Source Port
= 1357
Destination
Port = 25
Sequence Number
Acknowledgement
Number
Checksum
Message Data
SMTP port
= 1357
SMTP port
= 25
TCP/IP
27
Client A SMTP + FTP Server
Client B
SMTP port
= 1357
FTP port
= 1361
Network address:
158.132.161.99
SMTP port
= 25
FTP port
= 21
TCP/IP
28
Network Layer
Application
Transport
Network
Network Interface
Message
Segments
h M h M h M
h Mh h Mh h Mh
Datagrams / Packets
TCP/IP
29
E. Network Addresses and
Subnets
• A header is added to each segment in the
Network layer
IP3
Total
Length
Time to
Live
Protocol Header
CheckSum
Source Address
Destination Address
Segment
Segment
TCP/IP
30
• Total Length – Total length of a packet (up to
65535 bytes)
• Time to Live – How many times this packet can
be routed on the network (up to 255)
• Protocol – The transport layer protocol that
the packet belongs to
• TCP: 6
• UDP: 17
• ICMP: 1
• Source address – the network address of the
computer that sends the data
• Destination address – the network address of
the computer that the data is sending to
TCP/IP
31
• (Already mentioned)
• Each computer (host) must have a unique
network address (or IP address for TCP/IP suite)
• Each IP address is 32-bit long (four bytes)
• The four-byte address is written out as a.b.c.d
• e.g. Byte 1 Byte 2 Byte 3 Byte 4
158 132 161 99
• IP addresses are hierarchical
• network I.D. and host I.D.
• Each Network I.D. on the Internet needs to be
registered to the Internet Assigned Number
Authority
TCP/IP
32
Net I.D.
Class A – for very large network
Host I.D.0
1 bit 7 bits 24 bits
• Only 27
(63) networks can belong to this class
• Each network, there are 224
hosts or computers
• Very few class A networks in the world
• e.g. Arpanet – the earliest packet switched
WAN (started 40 years ago)
TCP/IP
33
Net I.D.
Class B – for medium size network
Host I.D.0
2 bits 14 bits 16 bits
• 214
(16384) networks can belong to this class
• Each network, there are 216
(65536) hosts or
computers
• XXXX’s address belongs to this group
• e.g. 158.132.14.1
1
1001 1110 1000 0100 0000 1110 0000 0001
Network I.D. Host I.D.
TCP/IP
34
Class C – for small network
Net I.D. Host I.D.0
3 bits 21 bits 8 bits
• 221
networks can belong to this class
• Each network, there are only 28
(256) hosts or
computers
11
TCP/IP
35
Class D – for multicast network
Group no.0
4 bits 28 bits
• Packets are addressed to a multicast group
• Not often supported on Internet
111
TCP/IP
36
Special Addresses
• Host I.D. = all ‘1’s ⇒ Directed broadcast
“Broadcast to all hosts in the network or
subnetwork”, not assigned
• Host I.D. = all ‘0’s ⇒ “This network”, not
assigned
• Network I.D. = 127 is reserved for loopback and
diagnostic purposes, not assigned
• Network I.D. + Host I.D. = all ‘1’s ⇒ Limited
broadcast
“Broadcast to all hosts in the current network”,
not assigned
TCP/IP
37
Subnets
• A class B address can have 65536 hosts
• Difficult to manage
• Usually subdivide into a few small subnets
• Subnetting can also help to reduce broadcasting
traffic
All traffic to
158.132.0.
158.132.0.0
Total 65536 hosts
Router Router
All traffic to
158.132.0.0
158.132.1.0
158.132.2.0
158.132.3.0
Each subnet 256 hosts
TCP/IP
38
Subnet Mask
• How does the router know which subnet a packet
should go?
• For each interface of the router, a subnet mask is
provided to redefine which part of the address is
Net ID and which part is Host ID
• Become classless addressing
A subnet mask: 255.255.255.0
1111 1111.1111 1111. 1111 1111. 0000 0000
‘1’s Net ID ‘0’s Host ID
TCP/IP
39
Router
A packet with
destination address
158.132.1.10
S0
E0 S1
S2
S0 S1 S2
Subnet 158.132.1.0 158.132.2.0 158.132.3.0
Mask 255.255.255.0 255.255.255.0 255.255.255.0
Routing Table
158.132. 1. 10
AND 255.255.255. 0
158.132. 1. 0
158.132.1.10
1001 1110.1000 0100.0000 0001.0000
1010
AND 1111 1111.1111 1111.1111 1111.0000 0000
1001 1110.1000 0100.0000 0001.0000
Advantage: easy to compute
TCP/IP
40
F. Overview Of Routing
• How a packet finds its way to a computer in a
network?
• By using Routers
• Routing is the selection of a path to guide a
packet from the source to the destination
• Criteria in selecting a path may be:
• Shortest path
• Quickest path
• Cheapest path
TCP/IP
41
Hong Kong
158.132.161.99
U.S.
212.64.123.98router
Internet
The red path is the
shortest path
TCP/IP
42
• Each router has a table that records the
estimated distance to all other routers
• If a router knows the entire network topology,
the shortest path can be calculated
• To achieve this, routers broadcast Link State
Advertisement to all other routers periodically
• By means of routing protocol
• Each router knows the exact topology, and
then calculates the shortest path
• In practice, it is not possible for a router to all
paths. Only the nearer ones are kept
• Hence can give wrong estimation
TCP/IP
43
Host A
158.132.148.66
Default gateway: Router C
Host B
160.64.123.98
Router C
S0
T1
T1
S1
T0
S1
S1
T0
S0
T0
T0
Router A
Subnet
160.64.123.0
Router B
Routing Table
Subnet
158.132.166.0
S1 158.132.166.0
255.255.255.0
Direct
T1 160. 64. 0. 0
255.255. 0. 0
Forward
Subnet
160.64.124.0
Routing Table
S0
S0
S1
160. 64.124.0
255.255.255.0
160. 64.123.0
255.255.255.0
Direct
Direct
TCP/IP
44
1. Host A wants to send a packet to Host B with address
160.64.123.98
2. Host A checks that 160.64.123.98 is not in the same
network
3. Send packet to default gateway (Router C)
4. Default gateway finds that it cannot provide the best
route for the packet, inform Host A to send the
packet to Router A next time
5. Router C sends the packet to Router A
6. Router A checks from the table the packet should
forward to Router B
7. Router B receives the packet and checks in its table
the packet should directly deliver to subnet
160.64.123.0
8. Host B (160.64.123.98) receives the packet
TCP/IP
45
Reference: Charles L. Hedrick, “Introduction to the Internet Protocols”, Rutgers
University, http://oac3.hsc.uth.tmc.edu/staff/snewton/tcp-tutorial/
Reference
TCP/IP

Contenu connexe

Tendances

Osi model vs TCP/IP
Osi model vs TCP/IPOsi model vs TCP/IP
Osi model vs TCP/IPMannu Khani
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network LayerManoj Kumar
 
Tcpip services and applications
Tcpip services and applicationsTcpip services and applications
Tcpip services and applicationsOnline
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networksguesta81d4b
 
Protocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteProtocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteAtharaw Deshmukh
 
Unit 1 introduction to computer networks
Unit 1  introduction to computer networksUnit 1  introduction to computer networks
Unit 1 introduction to computer networkspavan kumar Thatikonda
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer servicesMelvin Cabatuan
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithmBasit Hussain
 
Congestion control
Congestion controlCongestion control
Congestion controlAman Jaiswal
 

Tendances (20)

Osi model vs TCP/IP
Osi model vs TCP/IPOsi model vs TCP/IP
Osi model vs TCP/IP
 
Application Layer
Application Layer Application Layer
Application Layer
 
TCP and UDP
TCP and UDP TCP and UDP
TCP and UDP
 
Osi reference model
Osi reference modelOsi reference model
Osi reference model
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
Network protocals
Network protocalsNetwork protocals
Network protocals
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 
Tcpip services and applications
Tcpip services and applicationsTcpip services and applications
Tcpip services and applications
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networks
 
Data link layer
Data link layer Data link layer
Data link layer
 
Transport layer
Transport layer Transport layer
Transport layer
 
Protocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteProtocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol Suite
 
Unit 1 introduction to computer networks
Unit 1  introduction to computer networksUnit 1  introduction to computer networks
Unit 1 introduction to computer networks
 
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithm
 
computer network OSI layer
computer network OSI layercomputer network OSI layer
computer network OSI layer
 
Proxy Server
Proxy ServerProxy Server
Proxy Server
 
Congestion control
Congestion controlCongestion control
Congestion control
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 

En vedette

TCP Theory
TCP TheoryTCP Theory
TCP Theorysoohyunc
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over WirelessFarooq Khan
 
Actors, Fault tolerance and OTP
Actors, Fault tolerance and OTPActors, Fault tolerance and OTP
Actors, Fault tolerance and OTPDhananjay Nene
 
GYANM GENERAL AWARENESS ISSUE JULY 2014
GYANM GENERAL AWARENESS ISSUE JULY 2014GYANM GENERAL AWARENESS ISSUE JULY 2014
GYANM GENERAL AWARENESS ISSUE JULY 2014Grover's Gyanm
 
List of CrowdFunding Websites and much more!
List of CrowdFunding Websites and much more!List of CrowdFunding Websites and much more!
List of CrowdFunding Websites and much more!Ari Massoudi
 
TCP over wireless slides
TCP over wireless slidesTCP over wireless slides
TCP over wireless slidesMahesh Rajawat
 
Wireless technology - Wi-Fi
Wireless technology - Wi-FiWireless technology - Wi-Fi
Wireless technology - Wi-FiBhushan Jadhav
 
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi I
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi IJurnal lengkap Manajemen Dakwah UIN Jakarta Edisi I
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi IMuhammad Zen
 
Channel assignment strategies
Channel assignment strategiesChannel assignment strategies
Channel assignment strategiesAJAL A J
 
Security Issues in Android Custom ROM
Security Issues in Android Custom ROMSecurity Issues in Android Custom ROM
Security Issues in Android Custom ROMAnant Shrivastava
 

En vedette (18)

TCP Theory
TCP TheoryTCP Theory
TCP Theory
 
Lect9
Lect9Lect9
Lect9
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over Wireless
 
Actors, Fault tolerance and OTP
Actors, Fault tolerance and OTPActors, Fault tolerance and OTP
Actors, Fault tolerance and OTP
 
GYANM GENERAL AWARENESS ISSUE JULY 2014
GYANM GENERAL AWARENESS ISSUE JULY 2014GYANM GENERAL AWARENESS ISSUE JULY 2014
GYANM GENERAL AWARENESS ISSUE JULY 2014
 
List of CrowdFunding Websites and much more!
List of CrowdFunding Websites and much more!List of CrowdFunding Websites and much more!
List of CrowdFunding Websites and much more!
 
Who´s who in Spanish Wind Energy 2014
Who´s who in Spanish Wind Energy 2014Who´s who in Spanish Wind Energy 2014
Who´s who in Spanish Wind Energy 2014
 
Berlin
BerlinBerlin
Berlin
 
TCP over wireless slides
TCP over wireless slidesTCP over wireless slides
TCP over wireless slides
 
Blackbox(englisch)
Blackbox(englisch)Blackbox(englisch)
Blackbox(englisch)
 
Wireless technology - Wi-Fi
Wireless technology - Wi-FiWireless technology - Wi-Fi
Wireless technology - Wi-Fi
 
EPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & TricksEPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & Tricks
 
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi I
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi IJurnal lengkap Manajemen Dakwah UIN Jakarta Edisi I
Jurnal lengkap Manajemen Dakwah UIN Jakarta Edisi I
 
Channel assignment strategies
Channel assignment strategiesChannel assignment strategies
Channel assignment strategies
 
Trends in Technology
Trends in TechnologyTrends in Technology
Trends in Technology
 
Freenetlinks
FreenetlinksFreenetlinks
Freenetlinks
 
Security Issues in Android Custom ROM
Security Issues in Android Custom ROMSecurity Issues in Android Custom ROM
Security Issues in Android Custom ROM
 
Backlink iconia
Backlink iconiaBacklink iconia
Backlink iconia
 

Similaire à TCP/ IP

tcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtouseeqzulfiqar1
 
tcp ip protocols.ppt
tcp ip protocols.ppttcp ip protocols.ppt
tcp ip protocols.pptssuser3acfba
 
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...MathivananP4
 
Comptia Security + Chapter 1 501
Comptia Security           + Chapter 1 501Comptia Security           + Chapter 1 501
Comptia Security + Chapter 1 501AbdulalimBhnsawy
 
Get into Networking by Clearing Comptia Network+ Test
Get into Networking by Clearing Comptia Network+ TestGet into Networking by Clearing Comptia Network+ Test
Get into Networking by Clearing Comptia Network+ Testcertblaster
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.ppthoangdinhhanh88
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptanwarkade1
 
Ch 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewCh 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewSam Bowne
 
Datacom_Section_2_-_Protocols.ppt
Datacom_Section_2_-_Protocols.pptDatacom_Section_2_-_Protocols.ppt
Datacom_Section_2_-_Protocols.pptKristopher Hefner
 

Similaire à TCP/ IP (20)

tcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptx
 
tcp ip protocols.ppt
tcp ip protocols.ppttcp ip protocols.ppt
tcp ip protocols.ppt
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
 
Comptia Security + Chapter 1 501
Comptia Security           + Chapter 1 501Comptia Security           + Chapter 1 501
Comptia Security + Chapter 1 501
 
ADDRESSING PADA TCP IP
ADDRESSING PADA TCP IPADDRESSING PADA TCP IP
ADDRESSING PADA TCP IP
 
Get into Networking by Clearing Comptia Network+ Test
Get into Networking by Clearing Comptia Network+ TestGet into Networking by Clearing Comptia Network+ Test
Get into Networking by Clearing Comptia Network+ Test
 
Tcp ip
Tcp ipTcp ip
Tcp ip
 
Lecture set 7
Lecture set 7Lecture set 7
Lecture set 7
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.ppt
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.ppt
 
tcpip
tcpiptcpip
tcpip
 
Ch 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewCh 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts Review
 
Datacom_Section_2_-_Protocols.ppt
Datacom_Section_2_-_Protocols.pptDatacom_Section_2_-_Protocols.ppt
Datacom_Section_2_-_Protocols.ppt
 
User Datagram Protocol
User Datagram ProtocolUser Datagram Protocol
User Datagram Protocol
 
Tcp/ip
Tcp/ipTcp/ip
Tcp/ip
 
Tcp ip
Tcp ipTcp ip
Tcp ip
 
Overview of tcp ip
Overview of tcp ipOverview of tcp ip
Overview of tcp ip
 
TCP /IP
TCP /IPTCP /IP
TCP /IP
 
Web Engineering Lecture2
Web Engineering Lecture2 Web Engineering Lecture2
Web Engineering Lecture2
 

Plus de Harshit Srivastava

Introduction to intel galileo board gen2
Introduction to intel galileo board gen2Introduction to intel galileo board gen2
Introduction to intel galileo board gen2Harshit Srivastava
 
Impromptu ideas in respect of v2 v and other
Impromptu ideas in respect of v2 v and otherImpromptu ideas in respect of v2 v and other
Impromptu ideas in respect of v2 v and otherHarshit Srivastava
 
Prediction approach in predicting next user choice
Prediction approach in predicting next user choicePrediction approach in predicting next user choice
Prediction approach in predicting next user choiceHarshit Srivastava
 
Scale free network Visualiuzation
Scale free network VisualiuzationScale free network Visualiuzation
Scale free network VisualiuzationHarshit Srivastava
 
Emic Effects on controlling automobile safety
Emic Effects on controlling automobile safety Emic Effects on controlling automobile safety
Emic Effects on controlling automobile safety Harshit Srivastava
 
Emic effects in radio frequency instruments
Emic effects in radio frequency instrumentsEmic effects in radio frequency instruments
Emic effects in radio frequency instrumentsHarshit Srivastava
 
Anti collision technology of crashless cars
Anti collision technology of crashless carsAnti collision technology of crashless cars
Anti collision technology of crashless carsHarshit Srivastava
 

Plus de Harshit Srivastava (20)

Baseband processor final rev
Baseband processor final revBaseband processor final rev
Baseband processor final rev
 
Introduction to intel galileo board gen2
Introduction to intel galileo board gen2Introduction to intel galileo board gen2
Introduction to intel galileo board gen2
 
Impromptu ideas in respect of v2 v and other
Impromptu ideas in respect of v2 v and otherImpromptu ideas in respect of v2 v and other
Impromptu ideas in respect of v2 v and other
 
Prediction approach in predicting next user choice
Prediction approach in predicting next user choicePrediction approach in predicting next user choice
Prediction approach in predicting next user choice
 
Introduction to equalization
Introduction to equalizationIntroduction to equalization
Introduction to equalization
 
Scale free network Visualiuzation
Scale free network VisualiuzationScale free network Visualiuzation
Scale free network Visualiuzation
 
Emic Effects on controlling automobile safety
Emic Effects on controlling automobile safety Emic Effects on controlling automobile safety
Emic Effects on controlling automobile safety
 
Emic effects in radio frequency instruments
Emic effects in radio frequency instrumentsEmic effects in radio frequency instruments
Emic effects in radio frequency instruments
 
Vacuum circuit breaker
Vacuum circuit breakerVacuum circuit breaker
Vacuum circuit breaker
 
Stepper motor
Stepper motorStepper motor
Stepper motor
 
Rocket
RocketRocket
Rocket
 
Roboticsin army
Roboticsin armyRoboticsin army
Roboticsin army
 
Quark particles
Quark particlesQuark particles
Quark particles
 
Power system contingencies
Power system  contingenciesPower system  contingencies
Power system contingencies
 
Power plant technology
Power plant technologyPower plant technology
Power plant technology
 
Optical tweezers
Optical tweezersOptical tweezers
Optical tweezers
 
Nuclear technology
Nuclear technologyNuclear technology
Nuclear technology
 
E waste management in india
E  waste management in indiaE  waste management in india
E waste management in india
 
Carbon nanotubes
Carbon  nanotubesCarbon  nanotubes
Carbon nanotubes
 
Anti collision technology of crashless cars
Anti collision technology of crashless carsAnti collision technology of crashless cars
Anti collision technology of crashless cars
 

Dernier

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringJuanCarlosMorales19600
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 

Dernier (20)

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineering
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 

TCP/ IP

  • 1. Transmission Control Protocol TCP/IP Harshit Srivastava Department of Communication System Fall Semester 2012 Roll No. CDS12M001 Introduction and Special Techniques
  • 2. 2 TCP/IPTCP/IP FTP, SMTP, Telnet, HTTP,… TCP, UDP IP, ARP Network Interface
  • 3. 3 A. What is TCP/IP? • TCP/IP is a set of protocols developed to allow cooperating computers to share resources across a network • TCP stands for “Transmission Control Protocol” • IP stands for “Internet Protocol” • They are Transport layer and Network layer protocols respectively of the protocol suite • The most well known network that adopted TCP/IP is Internet – the biggest WAN in the world TCP/IP
  • 4. 4 • A protocol is a collection of rules and procedures for two computers to exchange information • Protocol also defines the format of data that is being exchanged What is a protocol? TCP/IP
  • 5. 5 Why TCP/IP is so popular? • TCP/IP was developed very early • Technologies were widely discussed and circulated in documents called “Request for Comments” (RFC) – free of charge • Supported by UNIX operating system TCP/IP
  • 6. 6 TCP/IP Model • Because TCP/IP was developed earlier than the OSI 7-layer mode, it does not have 7 layers but only 4 layers OSI 7-layerTCP/IP Protocol Suite FTP, SMTP, Telnet, HTTP,… TCP, UDP IP, ARP, ICMP Network Interface TCP/IP
  • 7. 7 • Application layer protocols define the rules when implementing specific network applications • Rely on the underlying layers to provide accurate and efficient data delivery • Typical protocols: • FTP – File Transfer Protocol • For file transfer • Telnet – Remote terminal protocol • For remote login on any other computer on the network • SMTP – Simple Mail Transfer Protocol • For mail transfer • HTTP – Hypertext Transfer Protocol • For Web browsing TCP/IP
  • 8. 8 • TCP/IP is built on “connectionless” technology, each datagram finds its own way to its destination • Transport Layer protocols define the rules of • Dividing a chunk of data into segments • Reassemble segments into the original chunk • Typical protocols: • TCP – Transmission Control Protocol • Provide further the functions such as reordering and data resend • UDP – User Datagram Service • Use when the message to be sent fit exactly into a datagram • Use also when a more simplified data format is required TCP/IP
  • 9. 9 • Network layer protocols define the rules of how to find the routes for a packet to the destination • It only gives best effort delivery. Packets can be delayed, corrupted, lost, duplicated, out-of-order • Typical protocols: • IP – Internet Protocol • Provide packet delivery • ARP – Address Resolution Protocol • Define the procedures of network address / MAC address translation • ICMP – Internet Control Message Protocol • Define the procedures of error message transfer TCP/IP
  • 11. 11 SMTP TCP IP, ARP, ICMP Network Interface SMTP TCP IP, ARP, ICMP Network Interface SMTP ServerClient Actual Virtual B. Example: SMTP TCP/IP
  • 12. 12 • The underlying layers have guaranteed accurate data delivery • We need to make a lot agreements with the server in application layer before sending mail 1. Agree on how data is represented • Binary or ASCII 2. Ensure the right recipient • There may be 1000 users served by the server 3. Ensure the client has the right to send mail • Some clients are not welcome 4. How to tell the server it is the end of the message • All mail looks the same : TCP/IP
  • 13. 13 • Example: SMTP The following mail is to be sent: Date: Fri, 18 Jan 02 13:26:31 IST From: harshxtime@iiitdm.in To: cds12m001@iiitdm.in Subject: meeting Let’s get together Monday at 1pm. TCP/IP
  • 14. 14 SMTP ServerClient access port 25 of server HELO iiitdm.in MAIL From: <cds12m001@iiitdm.ac.in> 220 cds.iiitdm.ac SMTP Service at 20 Jan 02 05:17:18 EDT 250 cds.iiitdm.ac – Hello, iitdm.in 250 MAIL accepted TCP/IP
  • 15. 15 Client SMTP Server Date: Fri, 18 Jan 02 13:26:31 EDT From: harshxtime@iiitdm.in To: cds12m001@iiitdm.in Subject: meeting Let’s get together Monday at 1pm. . RCPT To:<harshxtime@iiitdm.in> DATA 250 Recipient accepted 354 Start mail input; end with . TCP/IP
  • 16. 16 • The agreement made in the SMTP protocol • All messages use normal text • All ASCII characters • The responses all begin with numbers • To indicate the status when receiving the command • Some words are reserved words • HELO, MAIL, RCPT… • Mail ends with a line that contains only a period • The information passed with the SMTP messages • The recipient name • The sender name • The mail TCP/IP
  • 17. 17 C. Domain Name (mentioned before) • Every computer has a network address • e.g. 158.132.161.99 • To access a computer, we need to specify its network address • Human beings are weak in memorizing numbers • We prefer computer name or domain name • e.g. hkpu10.iiitdm.ac.in • Need a machine on the Internet to convert name to number TCP/IP
  • 18. 18 Client Domain Name Server (DNS) of XXXX.ac.in Address of www.yahoo.com Where is www.yahoo.co m?usually UDP DNS of com DNS of Yahoo.com Where is www.yahoo.co m? Address of www.Yahoo.com Where is yahoo.com? Address of the DNS of Yahoo.com Become client TCP/IP
  • 19. 19 • Nevertheless, such a complicated procedure needs not perform in most cases • Client computers usually remember the answers that it got before • It reduces the loading to the root DNS • To further reduce loading, there can be many root DNS on the Internet • e.g. there are a few “com” root DNS TCP/IP
  • 21. 21 D. TCP and UDP • TCP is a connection-oriented protocol • Does not mean it has a physical connection between sender and receiver • TCP provides the function to allow a connection virtually exists – also called virtual circuit • TCP provides the functions: • Dividing a chunk of data into segments • Reassembly segments into the original chunk • Provide further the functions such as reordering and data resend • Offering a reliable byte-stream delivery service TCP – Transmission Control Protocol TCP/IP
  • 22. 22 1 2 3 Sender Timeout retransmit A1 A3 1 3 Recipient 2 A2 TCP/IP
  • 23. 23 • A Typical Procedure • Sender • TCP divides a message into segments • Add sequence no. • Send the segments in sequence and wait for acknowledgement • If an acknowledgement for a segment is not received for a certain period of time, resend it until an acknowledgement is received • Recipient • When receiving segments, send the acknowledgement with correct number • Reassembly the segments back to the message TCP/IP
  • 24. 24 • A computer may perform a number of network applications at the same time • FTP + SMTP + HTTP, etc. • Each computer has only one network address, how can it serve so many applications at the same time? Port Multiplexing ⇒ by port multiplexing Network add: 158.132.161.99 Port 21 Port 25 Port 80 FTP SMTP HTTP TCP/IP
  • 25. 25 Well-known Port Numbers • Some port numbers are reserved for some purposes • Port 21: FTP – file transfer • Port 25: SMTP – mail transfer • Port 23: TELNET – remote login • Port 80: HTTP – Web access • These port numbers are well known to all computers in the network • E.g. whenever a client access port 25 of the server, it means the client needs SMTP service TCP/IP
  • 26. 26 Client SMTP Server Located by: network address + TCP port no. Source Port = 1357 Destination Port = 25 Sequence Number Acknowledgement Number Checksum Message Data SMTP port = 1357 SMTP port = 25 TCP/IP
  • 27. 27 Client A SMTP + FTP Server Client B SMTP port = 1357 FTP port = 1361 Network address: 158.132.161.99 SMTP port = 25 FTP port = 21 TCP/IP
  • 28. 28 Network Layer Application Transport Network Network Interface Message Segments h M h M h M h Mh h Mh h Mh Datagrams / Packets TCP/IP
  • 29. 29 E. Network Addresses and Subnets • A header is added to each segment in the Network layer IP3 Total Length Time to Live Protocol Header CheckSum Source Address Destination Address Segment Segment TCP/IP
  • 30. 30 • Total Length – Total length of a packet (up to 65535 bytes) • Time to Live – How many times this packet can be routed on the network (up to 255) • Protocol – The transport layer protocol that the packet belongs to • TCP: 6 • UDP: 17 • ICMP: 1 • Source address – the network address of the computer that sends the data • Destination address – the network address of the computer that the data is sending to TCP/IP
  • 31. 31 • (Already mentioned) • Each computer (host) must have a unique network address (or IP address for TCP/IP suite) • Each IP address is 32-bit long (four bytes) • The four-byte address is written out as a.b.c.d • e.g. Byte 1 Byte 2 Byte 3 Byte 4 158 132 161 99 • IP addresses are hierarchical • network I.D. and host I.D. • Each Network I.D. on the Internet needs to be registered to the Internet Assigned Number Authority TCP/IP
  • 32. 32 Net I.D. Class A – for very large network Host I.D.0 1 bit 7 bits 24 bits • Only 27 (63) networks can belong to this class • Each network, there are 224 hosts or computers • Very few class A networks in the world • e.g. Arpanet – the earliest packet switched WAN (started 40 years ago) TCP/IP
  • 33. 33 Net I.D. Class B – for medium size network Host I.D.0 2 bits 14 bits 16 bits • 214 (16384) networks can belong to this class • Each network, there are 216 (65536) hosts or computers • XXXX’s address belongs to this group • e.g. 158.132.14.1 1 1001 1110 1000 0100 0000 1110 0000 0001 Network I.D. Host I.D. TCP/IP
  • 34. 34 Class C – for small network Net I.D. Host I.D.0 3 bits 21 bits 8 bits • 221 networks can belong to this class • Each network, there are only 28 (256) hosts or computers 11 TCP/IP
  • 35. 35 Class D – for multicast network Group no.0 4 bits 28 bits • Packets are addressed to a multicast group • Not often supported on Internet 111 TCP/IP
  • 36. 36 Special Addresses • Host I.D. = all ‘1’s ⇒ Directed broadcast “Broadcast to all hosts in the network or subnetwork”, not assigned • Host I.D. = all ‘0’s ⇒ “This network”, not assigned • Network I.D. = 127 is reserved for loopback and diagnostic purposes, not assigned • Network I.D. + Host I.D. = all ‘1’s ⇒ Limited broadcast “Broadcast to all hosts in the current network”, not assigned TCP/IP
  • 37. 37 Subnets • A class B address can have 65536 hosts • Difficult to manage • Usually subdivide into a few small subnets • Subnetting can also help to reduce broadcasting traffic All traffic to 158.132.0. 158.132.0.0 Total 65536 hosts Router Router All traffic to 158.132.0.0 158.132.1.0 158.132.2.0 158.132.3.0 Each subnet 256 hosts TCP/IP
  • 38. 38 Subnet Mask • How does the router know which subnet a packet should go? • For each interface of the router, a subnet mask is provided to redefine which part of the address is Net ID and which part is Host ID • Become classless addressing A subnet mask: 255.255.255.0 1111 1111.1111 1111. 1111 1111. 0000 0000 ‘1’s Net ID ‘0’s Host ID TCP/IP
  • 39. 39 Router A packet with destination address 158.132.1.10 S0 E0 S1 S2 S0 S1 S2 Subnet 158.132.1.0 158.132.2.0 158.132.3.0 Mask 255.255.255.0 255.255.255.0 255.255.255.0 Routing Table 158.132. 1. 10 AND 255.255.255. 0 158.132. 1. 0 158.132.1.10 1001 1110.1000 0100.0000 0001.0000 1010 AND 1111 1111.1111 1111.1111 1111.0000 0000 1001 1110.1000 0100.0000 0001.0000 Advantage: easy to compute TCP/IP
  • 40. 40 F. Overview Of Routing • How a packet finds its way to a computer in a network? • By using Routers • Routing is the selection of a path to guide a packet from the source to the destination • Criteria in selecting a path may be: • Shortest path • Quickest path • Cheapest path TCP/IP
  • 42. 42 • Each router has a table that records the estimated distance to all other routers • If a router knows the entire network topology, the shortest path can be calculated • To achieve this, routers broadcast Link State Advertisement to all other routers periodically • By means of routing protocol • Each router knows the exact topology, and then calculates the shortest path • In practice, it is not possible for a router to all paths. Only the nearer ones are kept • Hence can give wrong estimation TCP/IP
  • 43. 43 Host A 158.132.148.66 Default gateway: Router C Host B 160.64.123.98 Router C S0 T1 T1 S1 T0 S1 S1 T0 S0 T0 T0 Router A Subnet 160.64.123.0 Router B Routing Table Subnet 158.132.166.0 S1 158.132.166.0 255.255.255.0 Direct T1 160. 64. 0. 0 255.255. 0. 0 Forward Subnet 160.64.124.0 Routing Table S0 S0 S1 160. 64.124.0 255.255.255.0 160. 64.123.0 255.255.255.0 Direct Direct TCP/IP
  • 44. 44 1. Host A wants to send a packet to Host B with address 160.64.123.98 2. Host A checks that 160.64.123.98 is not in the same network 3. Send packet to default gateway (Router C) 4. Default gateway finds that it cannot provide the best route for the packet, inform Host A to send the packet to Router A next time 5. Router C sends the packet to Router A 6. Router A checks from the table the packet should forward to Router B 7. Router B receives the packet and checks in its table the packet should directly deliver to subnet 160.64.123.0 8. Host B (160.64.123.98) receives the packet TCP/IP
  • 45. 45 Reference: Charles L. Hedrick, “Introduction to the Internet Protocols”, Rutgers University, http://oac3.hsc.uth.tmc.edu/staff/snewton/tcp-tutorial/ Reference TCP/IP