Network Protocol Network Protocol Application layer protocol - PowerPoint PPT Presentation


PPT – Network Protocol Network Protocol Application layer protocol PowerPoint presentation | free to download - id: 3bafa7-NzFmY


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

Network Protocol Network Protocol Application layer protocol


Network Protocol Network Protocol Application layer protocol Transport layer protocol Network layer protocol Link layer protocol Application Layer conceptual ... – PowerPoint PPT presentation

Number of Views:595
Avg rating:3.0/5.0
Slides: 80
Provided by: utcEduFa
Learn more at:


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Network Protocol Network Protocol Application layer protocol

Network Protocol
Network Protocol
  • Application layer protocol
  • Transport layer protocol
  • Network layer protocol
  • Link layer protocol

Application Layer
  • learn about protocols by examining popular
    application-level protocols
  • HTTP
  • FTP
  • SMTP / POP3 / IMAP
  • DNS
  • conceptual, implementation aspects of network
    application protocols
  • transport-layer service models
  • client-server paradigm
  • peer-to-peer paradigm

Application architectures
  • Client-server
  • Peer-to-peer (P2P)
  • Hybrid of client-server and P2P

Client-server archicture
  • server
  • always-on host
  • permanent IP address
  • server farms for scaling
  • clients
  • communicate with server
  • may be intermittently connected
  • may have dynamic IP addresses
  • do not communicate directly with each other

Pure P2P architecture
  • no always on server
  • arbitrary end systems directly communicate
  • peers are intermittently connected and change IP
  • example Gnutella
  • Highly scalable
  • But difficult to manage

Processes communicating
  • Process program running within a host.
  • within same host, two processes communicate using
    inter-process communication (defined by OS).
  • processes in different hosts communicate by
    exchanging messages
  • Client process process that initiates
  • Server process process that waits to be
  • Note applications with P2P architectures have
    client processes server processes

  • process sends/receives messages to/from its
  • socket analogous to door
  • sending process shoves message out door
  • sending process relies on transport
    infrastructure on other side of door which brings
    message to socket at receiving process

controlled by app developer
controlled by OS
Addressing processes
  • For a process to receive messages, it must have
    an identifier
  • A host has a unique32-bit IP address
  • Q does the IP address of the host on which the
    process runs suffice for identifying the process?
  • Answer No, many processes can be running on same
  • Identifier includes both the IP address and port
    numbers associated with the process on the host.
  • Example port numbers
  • HTTP server 80
  • Mail server 25

App-layer protocol defines
  • Types of messages exchanged, eg, request
    response messages
  • Syntax of message types what fields in messages
    how fields are delineated
  • Semantics of the fields, ie, meaning of
    information in fields
  • Rules for when and how processes send respond
    to messages

Internet transport protocols services
  • UDP service
  • unreliable data transfer between sending and
    receiving process
  • does not provide connection setup, reliability,
    flow control, congestion control, timing, or
    bandwidth guarantee
  • Q why bother? Why is there a UDP?
  • TCP service
  • connection-oriented setup required between
    client and server processes
  • reliable transport between sending and receiving
  • flow control sender wont overwhelm receiver
  • congestion control throttle sender when network
  • does not provide timing, minimum bandwidth

Web and HTTP
  • First some jargon
  • Web page consists of objects
  • Object can be HTML file, JPEG image, Java applet,
    audio file,
  • Web page consists of base HTML-file which
    includes several referenced objects
  • Each object is addressable by a URL
  • Example URL

HTTP overview
  • HTTP hypertext transfer protocol
  • Webs application layer protocol
  • client/server model
  • client browser that requests, receives,
    displays Web objects
  • server Web server sends objects in response to
  • HTTP 1.0 RFC 1945
  • HTTP 1.1 RFC 2068

HTTP request
PC running Explorer
HTTP response
HTTP request
Server running Apache Web server
HTTP response
Mac running Navigator
HTTP request message
  • two types of HTTP messages request, response
  • HTTP request message
  • ASCII (human-readable format)

request line (GET, POST, HEAD commands)
GET /somedir/page.html HTTP/1.1 Host User-agent
Mozilla/4.0 Connection close Accept-languagefr
(extra carriage return, line feed)
header lines
Carriage return, line feed indicates end of
HTTP request message general format
HTTP response message
status line (protocol status code status phrase)
HTTP/1.1 200 OK Connection close Date Thu, 06
Aug 1998 120015 GMT Server Apache/1.3.0
(Unix) Last-Modified Mon, 22 Jun 1998 ...
Content-Length 6821 Content-Type text/html
data data data data data ...
header lines
data, e.g., requested HTML file
FTP the file transfer protocol
file transfer
user at host
remote file system
  • transfer file to/from remote host
  • client/server model
  • client side that initiates transfer (either
    to/from remote)
  • server remote host
  • ftp RFC 959
  • ftp server port 21

FTP separate control, data connections
  • FTP client contacts FTP server at port 21,
    specifying TCP as transport protocol
  • Client obtains authorization over control
  • Client browses remote directory by sending
    commands over control connection.
  • When server receives a command for a file
    transfer, the server opens a TCP data connection
    to client
  • After transferring one file, server closes
  • Server opens a second TCP data connection to
    transfer another file.
  • Control connection out of band
  • FTP server maintains state current directory,
    earlier authentication

Electronic Mail
  • Three major components
  • user agents
  • mail servers
  • simple mail transfer protocol SMTP
  • User Agent
  • a.k.a. mail reader
  • composing, editing, reading mail messages
  • e.g., Eudora, Outlook, elm, Netscape Messenger
  • outgoing, incoming messages stored on server

Electronic Mail mail servers
  • Mail Servers
  • mailbox contains incoming messages for user
  • message queue of outgoing (to be sent) mail
  • SMTP protocol between mail servers to send email
  • client sending mail server
  • server receiving mail server

Electronic Mail SMTP RFC 2821
  • uses TCP to reliably transfer email message from
    client to server, port 25
  • direct transfer sending server to receiving
  • three phases of transfer
  • handshaking (greeting)
  • transfer of messages
  • closure

Scenario Alice sends message to Bob
  • 1) Alice uses UA to compose message and to
  • 2) Alices UA sends message to her mail server
    message placed in message queue
  • 3) Client side of SMTP opens TCP connection with
    Bobs mail server
  • 4) SMTP client sends Alices message over the TCP
  • 5) Bobs mail server places the message in Bobs
  • 6) Bob invokes his user agent to read message

Mail message format
  • SMTP protocol for exchanging email msgs
  • RFC 822 standard for text message format
  • header lines, e.g.,
  • To
  • From
  • Subject
  • body
  • the message, ASCII characters only

blank line
Message format multimedia extensions
  • MIME multimedia mail extension, RFC 2045, 2056
  • additional lines in msg header declare MIME
    content type

MIME version
method used to encode data
multimedia data type, subtype, parameter
encoded data
Mail access protocols
access protocol
receivers mail server
  • SMTP delivery/storage to receivers server
  • Mail access protocol retrieval from server
  • POP Post Office Protocol RFC 1939
  • authorization (agent lt--gtserver) and download
  • IMAP Internet Mail Access Protocol RFC 1730
  • more features (more complex)
  • manipulation of stored msgs on server
  • HTTP Hotmail , Yahoo! Mail, etc.

DNS Domain Name System
  • Domain Name System
  • distributed database implemented in hierarchy of
    many name servers
  • application-layer protocol host, routers, name
    servers to communicate to resolve names
    (address/name translation)
  • note core Internet function, implemented as
    application-layer protocol
  • People many identifiers
  • SSN, name, passport
  • Internet hosts, routers
  • IP address (32 bit) - used for addressing
  • name, e.g., - used by humans
  • Q map between IP addresses and name ?

  • Why not centralize DNS?
  • single point of failure
  • traffic volume
  • distant centralized database
  • maintenance
  • doesnt scale!
  • DNS services
  • Hostname to IP address translation
  • Host aliasing
  • Canonical and alias names
  • Mail server aliasing
  • Load distribution
  • Replicated Web servers set of IP addresses for
    one canonical name

Distributed, Hierarchical Database
  • Client wants IP for 1st approx
  • Client queries a root server to find com DNS
  • Client queries com DNS server to get
    DNS server
  • Client queries DNS server to get IP
    address for

Internet transport-layer protocols
Transport services and protocols
  • provide logical communication between app
    processes running 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
  • more than one transport protocol available to
  • Internet TCP and UDP

Transport vs. network layer
  • network layer logical communication between
  • transport layer logical communication between
  • relies on, enhances, network layer services

Internet transport-layer protocols
  • reliable, in-order delivery (TCP)
  • congestion control
  • flow control
  • connection setup
  • unreliable, unordered delivery UDP
  • no-frills extension of best-effort IP
  • services not available
  • delay guarantees
  • bandwidth guarantees

delivering received segments to correct socket
gathering data from multiple sockets, enveloping
data with header (later used for demultiplexing)
How demultiplexing works
32 bits
  • host receives IP datagrams
  • each datagram has source IP address, destination
    IP address
  • each datagram carries 1 transport-layer segment
  • each segment has source, destination port number
    host uses IP addresses port numbers to direct
    segment to appropriate socket

source port
dest port
other header fields
application data (message)
TCP/UDP segment format
Connectionless demultiplexing
  • When host receives UDP segment
  • checks destination port number in segment
  • directs UDP segment to socket with that port
  • IP datagrams with different source IP addresses
    and/or source port numbers directed to same socket
  • Create sockets with port numbers
  • DatagramSocket mySocket1 new DatagramSocket(9911
  • DatagramSocket mySocket2 new DatagramSocket(9922
  • UDP socket identified by two-tuple
  • (dest IP address, dest port number)

Connectionless demux (cont)
  • DatagramSocket serverSocket new

SP provides return address
UDP User Datagram Protocol RFC 768
  • best effort service, UDP segments may be
  • lost
  • delivered out of order to app
  • connectionless
  • no handshaking between UDP sender, receiver
  • each UDP segment handled independently of others
  • Why is there a UDP?
  • no connection establishment (which can add delay)
  • simple no connection state at sender, receiver
  • small segment header
  • no congestion control UDP can blast away as fast
    as desired

UDP more
  • often used for streaming multimedia apps
  • loss tolerant
  • rate sensitive
  • reliable transfer over UDP add reliability at
    application layer
  • application-specific error recovery!

32 bits
source port
dest port
Length, in bytes of UDP segment, including header
Application data (message)
UDP segment format
UDP checksum
  • Goal detect errors (e.g., flipped bits) in
    transmitted segment
  • Sender
  • treat segment contents as sequence of 16-bit
  • checksum addition (1s complement sum) of
    segment contents
  • sender puts checksum value into UDP checksum field
  • Receiver
  • compute checksum of received segment
  • check if computed checksum equals checksum field
  • NO - error detected
  • YES - no error detected. But maybe errors
    nonetheless? More later .

Internet Checksum Example
  • Note
  • When adding numbers, a carryout from the most
    significant bit needs to be added to the result
  • Example add two 16-bit integers

1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1
0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0
1 1
The Internet Network layer
The Internet Network layer
  • Host, router network layer functions

Transport layer TCP, UDP
Network layer
Link layer
physical layer
IP datagram format
NAT Network Address Translation
rest of Internet
local network (e.g., home network) 10.0.0/24
Datagrams with source or destination in this
network have 10.0.0/24 address for source,
destination (as usual)
All datagrams leaving local network have same
single source NAT IP address, differe
nt source port numbers
NAT Network Address Translation
  • Motivation local network uses just one IP
    address as far as outside word is concerned
  • no need to be allocated range of addresses from
    ISP - just one IP address is used for all
  • can change addresses of devices in local network
    without notifying outside world
  • can change ISP without changing addresses of
    devices in local network
  • devices inside local net not explicitly
    addressable, visible by outside world (a security

NAT Network Address Translation
  • Implementation NAT router must
  • outgoing datagrams replace (source IP address,
    port ) of every outgoing datagram to (NAT IP
    address, new port )
  • . . . remote clients/servers will respond using
    (NAT IP address, new port ) as destination
  • remember (in NAT translation table) every (source
    IP address, port ) to (NAT IP address, new port
    ) translation pair
  • incoming datagrams replace (NAT IP address, new
    port ) in dest fields of every incoming datagram
    with corresponding (source IP address, port )
    stored in NAT table

NAT Network Address Translation
NAT translation table WAN side addr LAN
side addr, 5001, 3345
4 NAT router changes datagram dest addr
from, 5001 to, 3345
3 Reply arrives dest. address,
ICMP Internet Control Message Protocol
  • used by hosts routers to communicate
    network-level information
  • error reporting unreachable host, network, port,
  • echo request/reply (used by ping)
  • network-layer above IP
  • ICMP msgs carried in IP datagrams
  • ICMP message type, code plus first 8 bytes of IP
    datagram causing error

Type Code description 0 0 echo
reply (ping) 3 0 dest. network
unreachable 3 1 dest host
unreachable 3 2 dest protocol
unreachable 3 3 dest port
unreachable 3 6 dest network
unknown 3 7 dest host unknown 4
0 source quench (congestion
control - not used) 8 0
echo request (ping) 9 0 route
advertisement 10 0 router
discovery 11 0 TTL expired 12 0
bad IP header
  • 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 Header (Cont)
Priority identify priority among datagrams in
flow Next header identify upper layer protocol
for data
Other Changes from IPv4
  • 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

Transition From IPv4 To IPv6
  • Not all routers can be upgraded simultaneous
  • no flag days
  • How will the network operate with mixed IPv4 and
    IPv6 routers?
  • Tunneling IPv6 carried as payload in IPv4
    datagram among IPv4 routers

B-to-C IPv6 inside IPv4
D-to-E IPv6 inside IPv4
Link Layer Protocol
Multiple Access Links and Protocols
  • Two types of links
  • point-to-point
  • PPP for dial-up access
  • point-to-point link between Ethernet switch and
  • broadcast (shared wire or medium)
  • traditional Ethernet
  • 802.11 wireless LAN

Multiple Access protocols
  • single shared broadcast channel
  • two or more simultaneous transmissions by nodes
  • collision if node receives two or more signals at
    the same time
  • multiple access protocol
  • distributed algorithm that determines how nodes
    share channel, i.e., determine when node can
  • communication about channel sharing must use
    channel itself!
  • no out-of-band channel for coordination

Ideal Multiple Access Protocol
  • Broadcast channel of rate R bps
  • 1. When one node wants to transmit, it can send
    at rate R.
  • 2. When M nodes want to transmit, each can send
    at average rate R/M
  • 3. Fully decentralized
  • no special node to coordinate transmissions
  • no synchronization of clocks, slots
  • 4. Simple

MAC Protocols a taxonomy
  • Three broad classes
  • Channel Partitioning
  • divide channel into smaller pieces (time slots,
    frequency, code)
  • allocate piece to node for exclusive use
  • Random Access
  • channel not divided, allow collisions
  • recover from collisions
  • Taking turns
  • Nodes take turns, but nodes with more to send can
    take longer turns

Channel Partitioning MAC protocols TDMA
  • TDMA time division multiple access
  • access to channel in "rounds"
  • each station gets fixed length slot (length pkt
    trans time) in each round
  • unused slots go idle
  • example 6-station LAN, 1,3,4 have pkt, slots
    2,5,6 idle
  • TDM (Time Division Multiplexing) channel divided
    into N time slots, one per user inefficient with
    low duty cycle users and at light load.
  • FDM (Frequency Division Multiplexing) frequency

Channel Partitioning MAC protocols FDMA
  • FDMA frequency division multiple access
  • channel spectrum divided into frequency bands
  • each station assigned fixed frequency band
  • unused transmission time in frequency bands go
  • example 6-station LAN, 1,3,4 have pkt, frequency
    bands 2,5,6 idle
  • FDM (Frequency Division Multiplexing) frequency

frequency bands
Random Access Protocols
  • When node has packet to send
  • transmit at full channel data rate R.
  • no a priori coordination among nodes
  • two or more transmitting nodes ? collision,
  • random access MAC protocol specifies
  • how to detect collisions
  • how to recover from collisions (e.g., via delayed
  • Examples of random access MAC protocols
  • slotted ALOHA

Slotted ALOHA
  • Assumptions
  • all frames same size
  • time is divided into equal size slots, time to
    transmit 1 frame
  • nodes start to transmit frames only at beginning
    of slots
  • nodes are synchronized
  • if 2 or more nodes transmit in slot, all nodes
    detect collision
  • Operation
  • when node obtains fresh frame, it transmits in
    next slot
  • no collision, node can send new frame in next
  • if collision, node retransmits frame in each
    subsequent slot with prob. p until success

Slotted ALOHA
  • Pros
  • single active node can continuously transmit at
    full rate of channel
  • highly decentralized only slots in nodes need to
    be in sync
  • simple
  • Cons
  • collisions, wasting slots
  • idle slots
  • nodes may be able to detect collision in less
    than time to transmit packet
  • clock synchronization

Slotted Aloha efficiency
  • For max efficiency with N nodes, find p that
    maximizes Np(1-p)N-1
  • For many nodes, take limit of Np(1-p)N-1 as N
    goes to infinity, gives 1/e .37

Efficiency is the long-run fraction of
successful slots when there are many nodes, each
with many frames to send
  • Suppose N nodes with many frames to send, each
    transmits in slot with probability p
  • prob that node 1 has success in a slot
  • prob that any node has a success Np(1-p)N-1

At best channel used for useful transmissions
37 of time!
Pure (unslotted) ALOHA
  • unslotted Aloha simpler, no synchronization
  • when frame first arrives
  • transmit immediately
  • collision probability increases
  • frame sent at t0 collides with other frames sent
    in t0-1,t01

CSMA (Carrier Sense Multiple Access)
  • CSMA listen before transmit
  • If channel sensed idle transmit entire frame
  • If channel sensed busy, defer transmission
  • Human analogy dont interrupt others!

CSMA collisions
spatial layout of nodes
collisions can still occur propagation delay
means two nodes may not hear each others
collision entire packet transmission time wasted
note role of distance propagation delay in
determining collision probability
CSMA/CD (Collision Detection)
  • CSMA/CD carrier sensing, deferral as in CSMA
  • collisions detected within short time
  • colliding transmissions aborted, reducing channel
  • collision detection
  • easy in wired LANs measure signal strengths,
    compare transmitted, received signals
  • difficult in wireless LANs receiver shut off
    while transmitting
  • human analogy the polite conversationalist

CSMA/CD collision detection
Taking Turns MAC protocols
  • channel partitioning MAC protocols
  • share channel efficiently and fairly at high load
  • inefficient at low load delay in channel access,
    1/N bandwidth allocated even if only 1 active
  • Random access MAC protocols
  • efficient at low load single node can fully
    utilize channel
  • high load collision overhead
  • taking turns protocols
  • look for best of both worlds!

Taking Turns MAC protocols
  • Polling
  • master node invites slave nodes to transmit in
  • concerns
  • polling overhead
  • latency
  • single point of failure (master)
  • Token passing
  • control token passed from one node to next
  • token message
  • concerns
  • token overhead
  • latency
  • single point of failure (token)

Summary of MAC protocols
  • What do you do with a shared media?
  • Channel Partitioning, by time, frequency or code
  • Time Division, Frequency Division
  • Random partitioning (dynamic),
  • carrier sensing easy in some technologies
    (wire), hard in others (wireless)
  • CSMA/CD used in Ethernet
  • CSMA/CA used in 802.11
  • Taking Turns
  • polling from a central site, token passing

MAC Addresses and ARP
  • 32-bit IP address
  • network-layer address
  • used to get datagram to destination IP subnet
  • MAC (or LAN or physical or Ethernet) address
  • used to get datagram from one interface to
    another physically-connected interface (same
  • 48 bit MAC address (for most LANs) burned in the
    adapter ROM

LAN Addresses and ARP
Each adapter on LAN has unique LAN address
Broadcast address FF-FF-FF-FF-FF-FF
LAN Address (more)
  • MAC address allocation administered by IEEE
  • manufacturer buys portion of MAC address space
    (to assure uniqueness)
  • Analogy
  • (a) MAC address like Social Security
  • (b) IP address like postal address
  • MAC flat address ? portability
  • can move LAN card from one LAN to another
  • IP hierarchical address NOT portable
  • depends on IP subnet to which node is attached

ARP Address Resolution Protocol
  • Each IP node (Host, Router) on LAN has ARP table
  • ARP Table IP/MAC address mappings for some LAN
  • lt IP address MAC address TTLgt
  • TTL (Time To Live) time after which address
    mapping will be forgotten (typically 20 min)
ARP protocol Same LAN (network)
  • A wants to send datagram to B, and Bs MAC
    address not in As ARP table.
  • A broadcasts ARP query packet, containing B's IP
  • Dest MAC address FF-FF-FF-FF-FF-FF
  • all machines on LAN receive ARP query
  • B receives ARP packet, replies to A with its
    (B's) MAC address
  • frame sent to As MAC address (unicast)
  • A caches (saves) IP-to-MAC address pair in its
    ARP table until information becomes old (times
  • soft state information that times out (goes
    away) unless refreshed
  • ARP is plug-and-play
  • nodes create their ARP tables without
    intervention from net administrator

Routing to another LAN
  • walkthrough send datagram from A to B via R
  • assume A knows B IP address
  • Two ARP tables in router R, one for each IP
    network (LAN)
  • In ARP table at source, find MAC address
    E6-E9-00-17-BB-4B, etc
  • In routing table at source Host, find router

  • A creates datagram with source A, destination B
  • A uses ARP to get Rs MAC address for
  • A creates link-layer frame with R's MAC address
    as dest, frame contains A-to-B IP datagram
  • As adapter sends frame
  • Rs adapter receives frame
  • R removes IP datagram from Ethernet frame, sees
    its destined to B
  • R uses ARP to get Bs MAC address
  • R creates frame containing A-to-B IP datagram
    sends to B