SlideShare a Scribd company logo
1 of 47
1
2
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
3
• 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
4
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
5
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-layer
TCP/IP Protocol Suite
FTP, SMTP, Telnet,
HTTP,…
TCP, UDP
IP, ARP, ICMP
Network Interface
TCP/IP
6
• 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
7
• 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
8
• 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
9
Application Layer
Application
Transport
Network
Network Interface
TCP/IP
10
SMTP
TCP
IP, ARP, ICMP
Network Interface
SMTP
TCP
IP, ARP, ICMP
Network Interface
SMTP Server
Client
Actual
Virtual
B. Example: SMTP
TCP/IP
11
• 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
12
• 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
13
C. Domain Name
• 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.polyu.edu.hk
• Need a machine on the Internet to convert name to number
TCP/IP
14
Domain name hierarchy
Example:
hkpu10.uoh.edu.sa
Root domain name
other examples:
com – commercial company
org – general organization
net – major network centre
gov – government org.
mil – militrary group
edu – education org.
•The domain
within sa
•Note: edu.sa
is not the
same as edu
•The domain
within edu.sa
•One of the
educational
institutions in
S.A.
Computer name
TCP/IP
15
• An organization needs to register its domain name
• e.g. uoh has registered its name to the domain
of edu.sa
• Once a domain name is assigned, the organization
is free to assign other names belong to its domain
• e.g. we can have
hkpu10.uoh.edu.sa
smtp.uoh.edu.sa
mail.uoh.edu.sa
TCP/IP
16
Client
Domain Name Server (DNS)
of uoh.edu.sa
Address of
www.yahoo.com
Where is
www.yahoo.com?
usually UDP
DNS of com
DNS of Yahoo.com
Where is
www.yahoo.com?
Address of
www.Yahoo.com
Where is yahoo.com?
Address of the
DNS of
Yahoo.com
Become
client
TCP/IP
17
• 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
18
Transport Layer
Application
Transport
Network
Network Interface
Message
Segments
h M h M h M
TCP/IP
19
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
20
Source Port Destination
Port
Sequence Number
Acknowledgement
Number
Checksum
Message Data
TCP
Dividing and Reassembly
Message
TCP/IP
21
• 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
22
• 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
23
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
24
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
25
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
26
Network Layer
Application
Transport
Network
Network Interface
Message
Segments
h M h M h M
h M
h h M
h h M
h
Datagrams / Packets
TCP/IP
27
E. Network Addresses and
Subnets
• A header is added to each segment in the
Network layer
IP
3
Total
Length
Time to
Live
Protocol Header
CheckSum
Source Address
Destination Address
Segment
Segment
TCP/IP
28
• 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
29
• (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
30
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
31
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
• Uoh’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
32
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
1
1
TCP/IP
33
Class D – for multicast network
Group no.
0
4 bits 28 bits
• Packets are addressed to a multicast group
• Not often supported on Internet
1
1
1
TCP/IP
34
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.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
35
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
36
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
Advantage: easy to compute
TCP/IP
37
F. 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
38
Hong Kong
158.132.161.99
U.S.
212.64.123.98
router
Internet
The red path is the
shortest path
TCP/IP
39
• 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
40
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
41
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
42
Data Link and
Physical Layers
Application
Transport
Network
Network Interface
Message
Segments
h M h M h M
h M
h h M
h h M
h
Packets
h M
h h M
h
h h
Frames
TCP/IP
43
G. Ethernet Encapsulation and
ARP
• An IP packet should be encapsulated into a
frame for transmission by data link layer
• e.g. if Ethernet (or IEEE 802.3) is used:
Preamble Des. Add Sour. Add Length IP Packet FCS
7
Bytes
2/6
Bytes
2/6
Bytes
2
Bytes
46 - 1500 Bytes 4
Bytes
1
Byte
IEEE 802.3 Frame
TCP/IP
44
• Only the hardware address (MAC address) is
unique to a host
• Need to convert a network address to MAC
address
Ethernet
Ethernet
Frame
Ethernet address = ?
Packet
Destination IP = 158.132.148.132
Source IP =
158.132.148.66
Packet
TCP/IP
45
ARP – Address Resolution Protocol
1. Broadcast: Who has got IP address
158.132.148.132? What’s your
Ethernet address?
2. Reply: I do. My Ethernet address is
00-60-8C-41-37-52
Case 1
Ethernet
Frame
3.
Ethernet address = 00-60-8C-41-37-52
TCP/IP
46
ARP – Address Resolution Protocol
Case 2
1. Broadcast: Who has got IP address
158.132.148.132? What’s your
Ethernet address?
2. Reply: The IP you indicated is not in your network.
You can give the packet to me first. My MAC address
is 00-60-8C-12-34-56
Router
3.
Ethernet
Frame
Ethernet address = 00-60-8C-12-34-56
TCP/IP
47
ARP Cache
• Will have a heavy traffic if so many ARP
broadcast messages are generated
• Each host will have a cache to store the
mappings (from IP to MAC address) that were
obtained before
• An entry will only be kept in the cache for a
limited amount of time (say, 2 minutes)
IP Address MAC Address
158.132.148.80 00-60-8C-27-35-9A
158.132.148.28 02-60-8C-1A-37-49
TCP/IP

More Related Content

What's hot

Networking and Internetworking Devices
Networking and Internetworking DevicesNetworking and Internetworking Devices
Networking and Internetworking Devices21viveksingh
 
ACM code of ethics
ACM code of ethicsACM code of ethics
ACM code of ethicsMuhammad Haroon
 
Cs8591 Computer Networks - UNIT V
Cs8591 Computer Networks - UNIT VCs8591 Computer Networks - UNIT V
Cs8591 Computer Networks - UNIT Vpkaviya
 
Transport Protocols
Transport ProtocolsTransport Protocols
Transport ProtocolsPeter R. Egli
 
Tcp/ip model
Tcp/ip  modelTcp/ip  model
Tcp/ip modelKumar Alok
 
Network Layer & Transport Layer
Network Layer & Transport LayerNetwork Layer & Transport Layer
Network Layer & Transport LayerSweta Kumari Barnwal
 
Chapter04 -- network protocols
Chapter04  -- network protocolsChapter04  -- network protocols
Chapter04 -- network protocolsRaja Waseem Akhtar
 
Data link layer
Data link layer Data link layer
Data link layer Mukesh Chinta
 
Data link layer
Data link layerData link layer
Data link layersbkbca
 
Framing in data link layer
Framing in data link layerFraming in data link layer
Framing in data link layerAhtesham Ullah khan
 
Chapter 2 - Network Models
Chapter 2 - Network ModelsChapter 2 - Network Models
Chapter 2 - Network ModelsWayne Jones Jnr
 
Introduction to TCP/IP
Introduction to TCP/IPIntroduction to TCP/IP
Introduction to TCP/IPMichael Lamont
 
04. availability-concepts
04. availability-concepts04. availability-concepts
04. availability-conceptsMuhammad Ahad
 

What's hot (20)

transport layer
transport layertransport layer
transport layer
 
High speed lan
High speed lanHigh speed lan
High speed lan
 
Networking and Internetworking Devices
Networking and Internetworking DevicesNetworking and Internetworking Devices
Networking and Internetworking Devices
 
TCP/IP MODEL
TCP/IP MODEL TCP/IP MODEL
TCP/IP MODEL
 
Layered Architecture
Layered ArchitectureLayered Architecture
Layered Architecture
 
ACM code of ethics
ACM code of ethicsACM code of ethics
ACM code of ethics
 
Cs8591 Computer Networks - UNIT V
Cs8591 Computer Networks - UNIT VCs8591 Computer Networks - UNIT V
Cs8591 Computer Networks - UNIT V
 
Transport Protocols
Transport ProtocolsTransport Protocols
Transport Protocols
 
Tcp/ip model
Tcp/ip  modelTcp/ip  model
Tcp/ip model
 
TCP/IP Introduction
TCP/IP IntroductionTCP/IP Introduction
TCP/IP Introduction
 
Network Layer & Transport Layer
Network Layer & Transport LayerNetwork Layer & Transport Layer
Network Layer & Transport Layer
 
Chapter04 -- network protocols
Chapter04  -- network protocolsChapter04  -- network protocols
Chapter04 -- network protocols
 
FTP & TFTP
FTP & TFTPFTP & TFTP
FTP & TFTP
 
Data link layer
Data link layer Data link layer
Data link layer
 
TCP /IP
TCP /IPTCP /IP
TCP /IP
 
Data link layer
Data link layerData link layer
Data link layer
 
Framing in data link layer
Framing in data link layerFraming in data link layer
Framing in data link layer
 
Chapter 2 - Network Models
Chapter 2 - Network ModelsChapter 2 - Network Models
Chapter 2 - Network Models
 
Introduction to TCP/IP
Introduction to TCP/IPIntroduction to TCP/IP
Introduction to TCP/IP
 
04. availability-concepts
04. availability-concepts04. availability-concepts
04. availability-concepts
 

Similar to What is TCP/IP? Understanding the Fundamentals

tcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtouseeqzulfiqar1
 
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
 
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
 
Introduction to TCP / IP in networking Technology
Introduction to TCP / IP in networking TechnologyIntroduction to TCP / IP in networking Technology
Introduction to TCP / IP in networking Technologyroykousik2020
 
ADDRESSING PADA TCP IP
ADDRESSING PADA TCP IPADDRESSING PADA TCP IP
ADDRESSING PADA TCP IPJennifer Daniel
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- finalTaymoor Nazmy
 
Ismail TCP IP.pdf
Ismail TCP IP.pdfIsmail TCP IP.pdf
Ismail TCP IP.pdfhelloraja
 
Ismail TCP IP.pdf
Ismail TCP IP.pdfIsmail TCP IP.pdf
Ismail TCP IP.pdfhelloraja
 
Ch 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewCh 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewSam Bowne
 
Comptia Security + Chapter 1 501
Comptia Security           + Chapter 1 501Comptia Security           + Chapter 1 501
Comptia Security + Chapter 1 501AbdulalimBhnsawy
 
TCPIP SLIDES.ppt
TCPIP SLIDES.pptTCPIP SLIDES.ppt
TCPIP SLIDES.pptaymenshykh
 

Similar to What is TCP/IP? Understanding the Fundamentals (20)

TCP/IP
TCP/IPTCP/IP
TCP/IP
 
tcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptx
 
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...
 
TCP/ IP
TCP/ IP TCP/ IP
TCP/ IP
 
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.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
Introduction to TCP / IP in networking Technology
Introduction to TCP / IP in networking TechnologyIntroduction to TCP / IP in networking Technology
Introduction to TCP / IP in networking Technology
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
Tcp ip
Tcp ipTcp ip
Tcp ip
 
ADDRESSING PADA TCP IP
ADDRESSING PADA TCP IPADDRESSING PADA TCP IP
ADDRESSING PADA TCP IP
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- final
 
Ismail TCP IP.pdf
Ismail TCP IP.pdfIsmail TCP IP.pdf
Ismail TCP IP.pdf
 
Ismail TCP IP.pdf
Ismail TCP IP.pdfIsmail TCP IP.pdf
Ismail TCP IP.pdf
 
Ch 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts ReviewCh 2: TCP/IP Concepts Review
Ch 2: TCP/IP Concepts Review
 
Comptia Security + Chapter 1 501
Comptia Security           + Chapter 1 501Comptia Security           + Chapter 1 501
Comptia Security + Chapter 1 501
 
TCPIP SLIDES.ppt
TCPIP SLIDES.pptTCPIP SLIDES.ppt
TCPIP SLIDES.ppt
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

What is TCP/IP? Understanding the Fundamentals

  • 1. 1
  • 2. 2 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
  • 3. 3 • 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
  • 4. 4 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
  • 5. 5 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-layer TCP/IP Protocol Suite FTP, SMTP, Telnet, HTTP,… TCP, UDP IP, ARP, ICMP Network Interface TCP/IP
  • 6. 6 • 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
  • 7. 7 • 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
  • 8. 8 • 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. 10 SMTP TCP IP, ARP, ICMP Network Interface SMTP TCP IP, ARP, ICMP Network Interface SMTP Server Client Actual Virtual B. Example: SMTP TCP/IP
  • 11. 11 • 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
  • 12. 12 • 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
  • 13. 13 C. Domain Name • 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.polyu.edu.hk • Need a machine on the Internet to convert name to number TCP/IP
  • 14. 14 Domain name hierarchy Example: hkpu10.uoh.edu.sa Root domain name other examples: com – commercial company org – general organization net – major network centre gov – government org. mil – militrary group edu – education org. •The domain within sa •Note: edu.sa is not the same as edu •The domain within edu.sa •One of the educational institutions in S.A. Computer name TCP/IP
  • 15. 15 • An organization needs to register its domain name • e.g. uoh has registered its name to the domain of edu.sa • Once a domain name is assigned, the organization is free to assign other names belong to its domain • e.g. we can have hkpu10.uoh.edu.sa smtp.uoh.edu.sa mail.uoh.edu.sa TCP/IP
  • 16. 16 Client Domain Name Server (DNS) of uoh.edu.sa Address of www.yahoo.com Where is www.yahoo.com? usually UDP DNS of com DNS of Yahoo.com Where is www.yahoo.com? Address of www.Yahoo.com Where is yahoo.com? Address of the DNS of Yahoo.com Become client TCP/IP
  • 17. 17 • 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
  • 19. 19 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
  • 20. 20 Source Port Destination Port Sequence Number Acknowledgement Number Checksum Message Data TCP Dividing and Reassembly Message TCP/IP
  • 21. 21 • 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
  • 22. 22 • 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
  • 23. 23 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
  • 24. 24 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
  • 25. 25 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
  • 26. 26 Network Layer Application Transport Network Network Interface Message Segments h M h M h M h M h h M h h M h Datagrams / Packets TCP/IP
  • 27. 27 E. Network Addresses and Subnets • A header is added to each segment in the Network layer IP 3 Total Length Time to Live Protocol Header CheckSum Source Address Destination Address Segment Segment TCP/IP
  • 28. 28 • 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
  • 29. 29 • (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
  • 30. 30 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
  • 31. 31 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 • Uoh’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
  • 32. 32 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 1 1 TCP/IP
  • 33. 33 Class D – for multicast network Group no. 0 4 bits 28 bits • Packets are addressed to a multicast group • Not often supported on Internet 1 1 1 TCP/IP
  • 34. 34 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.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
  • 35. 35 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
  • 36. 36 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 Advantage: easy to compute TCP/IP
  • 37. 37 F. 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
  • 39. 39 • 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
  • 40. 40 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
  • 41. 41 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
  • 42. 42 Data Link and Physical Layers Application Transport Network Network Interface Message Segments h M h M h M h M h h M h h M h Packets h M h h M h h h Frames TCP/IP
  • 43. 43 G. Ethernet Encapsulation and ARP • An IP packet should be encapsulated into a frame for transmission by data link layer • e.g. if Ethernet (or IEEE 802.3) is used: Preamble Des. Add Sour. Add Length IP Packet FCS 7 Bytes 2/6 Bytes 2/6 Bytes 2 Bytes 46 - 1500 Bytes 4 Bytes 1 Byte IEEE 802.3 Frame TCP/IP
  • 44. 44 • Only the hardware address (MAC address) is unique to a host • Need to convert a network address to MAC address Ethernet Ethernet Frame Ethernet address = ? Packet Destination IP = 158.132.148.132 Source IP = 158.132.148.66 Packet TCP/IP
  • 45. 45 ARP – Address Resolution Protocol 1. Broadcast: Who has got IP address 158.132.148.132? What’s your Ethernet address? 2. Reply: I do. My Ethernet address is 00-60-8C-41-37-52 Case 1 Ethernet Frame 3. Ethernet address = 00-60-8C-41-37-52 TCP/IP
  • 46. 46 ARP – Address Resolution Protocol Case 2 1. Broadcast: Who has got IP address 158.132.148.132? What’s your Ethernet address? 2. Reply: The IP you indicated is not in your network. You can give the packet to me first. My MAC address is 00-60-8C-12-34-56 Router 3. Ethernet Frame Ethernet address = 00-60-8C-12-34-56 TCP/IP
  • 47. 47 ARP Cache • Will have a heavy traffic if so many ARP broadcast messages are generated • Each host will have a cache to store the mappings (from IP to MAC address) that were obtained before • An entry will only be kept in the cache for a limited amount of time (say, 2 minutes) IP Address MAC Address 158.132.148.80 00-60-8C-27-35-9A 158.132.148.28 02-60-8C-1A-37-49 TCP/IP