You are on page 1of 35

Fundamental of

Networking
Protocols
 TCP/IP Protocol Suite
 OSI vs TCP/IP Model
 IP Addressing
 Public vs Private IP Address
 IPv6
 TCP 3-Way Handshake
 UDP
 ARP
 DHCP
 DNS
 ICMP

Contents
How Internet Work
PC
• billions of connected mobile network
server computing devices:
wireless
• hosts = end systems global ISP
laptop • running network apps
smartphone
home
 communication links network
• fiber, copper, radio, satellite regional ISP
wireless • transmission rate:
links bandwidth
wired
links

 packet switches: forward packets


router (chunks of data)
• routers and switches institutional
network

What is Internet
mobile network

• Internet: “network of networks” global ISP


• Interconnected ISPs
• protocols control sending, home
receiving of messages network
regional ISP
• e.g., TCP, IP, HTTP, Skype, 802.11
• Internet standards
• RFC: Request for comments
• IETF: Internet Engineering Task
Force
institutional
network

What is Internet
layers: each layer implements a service
 via its own internal-layer actions
 relying on services provided by layer below

ticket (purchase) ticket (complain) ticket

baggage (check) baggage (claim baggage

gates (load) gates (unload) gate

runway (takeoff) runway (land) takeoff/landing

airplane routing airplane routing airplane routing airplane routing airplane routing

departure intermediate air-traffic arrival


airport control centers airport

Layering in Airlines
• presentation: allow applications to
interpret meaning of data, e.g.,
encryption, compression, machine- application
specific conventions
presentation
• session: synchronization,
checkpointing, recovery of data session
exchange
transport
• Internet stack “missing” these
layers! network
• these services, if needed, must be link
implemented in application
• needed? physical

OSI Layer
• application: supporting network
applications
• FTP, SMTP, HTTP
application
• transport: process-process data
transfer
• TCP, UDP transport
• network: routing of datagrams from
source to destination network
• IP, routing protocols
• link: data transfer between link
neighboring network elements
• Ethernet, 802.111 (WiFi), PPP
physical
• physical: bits “on the wire”

Internet Protocol Layer


source

Enskapsulasi
message M application
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical

switch

destination Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
1-9
physical
Introduction
human protocols:
• “what’s the time?”
• “I have a question”
• introductions

… specific messages sent


… specific actions taken when messages received, or other
events

What is Protocol?
• protocols define format, order of messages sent and received
among network entities, and actions taken on message
transmission, receipt
• protocols control sending, receiving of messages
• e.g., TCP, IP, HTTP, Skype, 802.11

What is Protocol?
Transport Protocol
application underlying
application layer protocol transport protocol

e-mail SMTP [RFC 2821] TCP


remote terminal access Telnet [RFC 854] TCP
Web HTTP [RFC 2616] TCP
file transfer FTP [RFC 959] TCP
streaming multimedia HTTP (e.g., YouTube), TCP or UDP
RTP [RFC 1889]
Internet telephony SIP, RTP, proprietary
(e.g., Skype) TCP or UDP

Application and Transport Protocol


application
 provide logical communication transport
network
between app processes running data link
physical
on different hosts
 transport protocols run in end
systems
• send side: breaks app messages
into segments, passes to network
layer
• rcv side: reassembles segments
into messages, passes to app layer application
transport

 more than one transport network


data link
physical
protocol available to apps
• Internet: TCP and UDP

Transport Protocol
 point-to-point:  full duplex data:
• one sender, one receiver • bi-directional data flow in
 reliable, in-order byte steam: same connection
• MSS: maximum segment
• no “message boundaries” size
 pipelined:  connection-oriented:
• TCP congestion and flow • handshaking (exchange of
control set window size control msgs) inits sender,
receiver state before data
exchange
 flow controlled:
• sender will not overwhelm
receiver

TCP Protocol
application
transport

 reliable, in-order delivery (TCP) network


data link
physical
network
• congestion control network data link
data link physical
• flow control physical
network
data link
• connection setup physical

network
 unreliable, unordered delivery: UDP data link
physical

• no-frills extension of “best-effort” IP network


data link
physical
 services not available: network
data link application
physical transport
• delay guarantees network
data link network
data link
physical
• bandwidth guarantees physical

Transport Protocol - TCP


client state server state
LISTEN LISTEN
choose init seq num, x
send TCP SYN msg
SYNSENT SYNbit=1, Seq=x
choose init seq num, y
send TCP SYNACK
msg, acking SYN SYN RCVD
SYNbit=1, Seq=y
ACKbit=1; ACKnum=x+1
received SYNACK(x)
ESTAB indicates server is live;
send ACK for SYNACK;
this segment may contain ACKbit=1, ACKnum=y+1
client-to-server data
received ACK(y)
indicates client is live
ESTAB

3 way handshake
• transport segment from sending to receiving host
• on sending side encapsulates segments into datagrams
• on receiving side, delivers segments to transport layer
• network layer protocols in every host, router
• router examines header fields in all IP datagrams passing
through it

Network Layer
• host, router network layer functions:

transport layer: TCP, UDP

routing protocols IP protocol


• path selection • addressing conventions
• RIP, OSPF, BGP • datagram format
network • packet handling conventions
layer forwarding
table
ICMP protocol
• error reporting
• router
“signaling”
link layer

physical layer

Internet Network Layer


• used by hosts & routers to
communicate network-level Type Code description
0 0 echo reply (ping)
information 3 0 dest. network unreachable
• error reporting: unreachable 3 1 dest host unreachable
host, network, port, protocol 3 2 dest protocol unreachable
• echo request/reply (used by 3 3 dest port unreachable
ping) 3 6 dest network unknown
3 7 dest host unknown
• network-layer “above” IP:
4 0 source quench (congestion
• ICMP msgs carried in IP control - not used)
datagrams 8 0 echo request (ping)
• ICMP message: type, code 9 0 route advertisement
plus first 8 bytes of IP 10 0 router discovery
datagram causing error 11 0 TTL expired
12 0 bad IP header

ICMP
223.1.1.1

• IP address: 32-bit identifier 223.1.2.1

for host, router interface


223.1.1.2
• interface: connection 223.1.1.4 223.1.2.9

between host/router and


physical link 223.1.1.3
223.1.3.27
223.1.2.2
• router’s typically have
multiple interfaces
• host typically has one or 223.1.3.1 223.1.3.2
two interfaces (e.g., wired
Ethernet, wireless 802.11)
• IP addresses associated with 223.1.1.1 = 11011111 00000001 00000001 00000001
each interface
223 1 1 1

IP Addressing
Q: How does a host get IP address?

• hard-coded by system admin in a file


• Windows: control-panel->network->configuration->tcp/ip-
>properties
• UNIX: /etc/rc.config
• DHCP: Dynamic Host Configuration Protocol:
dynamically get address from as server
• “plug-and-play”

IP Addressing
goal: allow host to dynamically obtain its IP address from network
server when it joins network
• can renew its lease on address in use
• allows reuse of addresses (only hold address while
connected/“on”)
• support for mobile users who want to join network (more
shortly)
DHCP overview:
• host broadcasts “DHCP discover” msg [optional]
• DHCP server responds with “DHCP offer” msg [optional]
• host requests IP address: “DHCP request” msg
• DHCP server sends address: “DHCP ack” msg

DHCP
DHCP
223.1.1.0/24
server
223.1.1.1 223.1.2.1

223.1.1.2 arriving DHCP


223.1.1.4 223.1.2.9
client needs
address in this
223.1.3.27
223.1.2.2 network
223.1.1.3

223.1.2.0/24

223.1.3.1 223.1.3.2

223.1.3.0/24

DHCP Client – Server Scenario


DHCP server: 223.1.2.5 DHCP discover arriving
client
src : 0.0.0.0, 68
Broadcast: is there a
dest.: 255.255.255.255,67
DHCPyiaddr:
server 0.0.0.0
out there?

DHCP Client-
transaction ID: 654

DHCP offer

Server Scenario src: 223.1.2.5, 67


Broadcast:
server!
I’m a DHCP
dest: 255.255.255.255,
yiaddrr:Here’s
68
an IP
223.1.2.4
address youID:can
transaction 654 use
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
Broadcast: OK. I’ll take
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
that IP address!
transaction ID: 655
lifetime: 3600 secs

DHCP ACK
src: 223.1.2.5, 67
Broadcast: OK. You’ve
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs
• initial motivation: 32-bit address space soon to be
completely allocated.
• additional motivation:
• header format helps speed processing/forwarding
• header changes to facilitate QoS

IPv6 datagram format:


• fixed-length 40 byte header
• no fragmentation allowed

IPv6 Motivation
• priority: identify priority among datagrams in flow
• flow Label: identify datagrams in same “flow.”
• (concept of“flow” not well defined).
• next header: identify upper layer protocol for data

ver pri flow label


payload len next hdr hop limit
source address
(128 bits)
destination address
(128 bits)

data

32 bits

IPv6 Datagram Format


• checksum: removed entirely to reduce processing time at
each hop
• options: allowed, but outside of header, indicated by
“Next Header” field
• ICMPv6: new version of ICMP
• additional message types, e.g. “Packet Too Big”
• multicast group management functions

Other Change From IPv4


• 32-bit IP address:
• network-layer address for interface
• used for layer 3 (network layer) forwarding
• MAC (or LAN or physical or Ethernet) address:
• function: used ‘locally” to get frame from one interface to another
physically-connected interface (same network, in IP-addressing
sense)
• 48 bit MAC address (for most LANs) burned in NIC ROM,
also sometimes software settable
• e.g.: 1A-2F-BB-76-09-AD
hexadecimal (base 16) notation
(each “numeral” represents 4 bits)

MAC Address and ARP (Link Layer)


each adapter on LAN has unique LAN address

1A-2F-BB-76-09-AD

LAN
(wired or adapter
wireless)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

MAC Address and ARP (Link Layer)


• MAC address allocation administered by IEEE
• manufacturer buys portion of MAC address space (to
assure uniqueness)
• analogy:
• MAC address: like Social Security Number
• IP address: like postal address
• MAC flat address ➜ portability
• can move LAN card from one LAN to another
• IP hierarchical address not portable
• address depends on IP subnet to which node is attached

MAC Address and ARP (Link Layer)


Question: how to determine
interface’s MAC address,
knowing its IP address?
ARP table: each IP node (host,
137.196.7.78
router) on LAN has table
1A-2F-BB-76-09-AD • IP/MAC address mappings
137.196.7.23 for some LAN nodes:
137.196.7.14
< IP address; MAC address; TTL>

LAN • TTL (Time To Live): time


71-65-F7-2B-08-53
after which address
58-23-D7-FA-20-B0
mapping will be forgotten
(typically 20 min)
0C-C4-11-6F-E3-98
137.196.7.88

ARP (Link Layer) 6-32


Root DNS Servers

… …

com DNS servers org DNS servers edu DNS servers

pbs.org poly.edu umass.edu


yahoo.com amazon.com
DNS servers DNS serversDNS servers
DNS servers DNS servers

client wants IP for www.amazon.com; 1st approximation:


• client queries root server to find com DNS server
• client queries .com DNS server to get amazon.com DNS server
• client queries amazon.com DNS server to get IP address for
www.amazon.com

DNS Server
DNS Name Resolution root DNS server

Example 2
3
TLD DNS server
4
• host at cis.poly.edu
5
wants IP address for
gaia.cs.umass.edu local DNS server
dns.poly.edu
iterated query: 1 8
7 6
 contacted server
replies with name of authoritative DNS server
server to contact dns.cs.umass.edu
requesting host
 “I don’t know this cis.poly.edu
name, but ask this
server” gaia.cs.umass.edu
Thank You

You might also like