Upload
chandrashekhar-m-mankar
View
135
Download
3
Embed Size (px)
DESCRIPTION
Sant Gadge Baba Ameavati University, Amravati Final Year Computer Science & Engineering Course PPT Subject: CNI Computer Network & Internet Code: 7SR3
Citation preview
Unit - 4
Unit-IV:Unit-IV: Link Layer: Introduction, Services, Error Introduction, Services, Error detection & correction techniques, detection & correction techniques, Multiple Access Protocols, LAN address Multiple Access Protocols, LAN address & ARP, CSMA/CD, PPP details& ARP, CSMA/CD, PPP details, Multimedia Multimedia networking and RTSP protocol, RTP details.networking and RTSP protocol, RTP details.
WELCOMEWELCOME
Unit - 4
Some terms:Some terms: hosts and routers are
nodes communication channels
that connect adjacent nodes along communication path are links wired links wireless links LANs
layer-2 packet is a frame, encapsulates datagram
“link”
data-link layer has responsibility of has responsibility of transferring datagram from one node transferring datagram from one node to to adjacentadjacent node over a link node over a link
MessageDatagramSegmentPacketFrame
Unit - 4
tourist = datagram transport segment = communication link transportation mode = link layer protocol travel agent = routing algorithm
tourist = datagram transport segment = communication link transportation mode = link layer protocol travel agent = routing algorithm
Data Link Layer ServicesData Link Layer Services
DLL is responsible for moving frames from one hop (node) to the next.Other responsibilities of DLL are:Framing: DLL provides the stream of bits received from n/w layer into manageable data unit called frames.
Physical Addressing: DLL adds a header to the frame to define the sender or receiver of the frame.
Flow Control: Rate at which receiver is absorbing data is less than produced by the sender. DLL imposes the FC to prevent overwhelming the receiver.
Error Control: DLL adds reliability to PLL by adding mechanism to detect and transmit damaged frames or lost frames. Error control is achieved through a trailer added to end of the fame
DLL is responsible for moving frames from one hop (node) to the next.Other responsibilities of DLL are:Framing: DLL provides the stream of bits received from n/w layer into manageable data unit called frames.
Physical Addressing: DLL adds a header to the frame to define the sender or receiver of the frame.
Flow Control: Rate at which receiver is absorbing data is less than produced by the sender. DLL imposes the FC to prevent overwhelming the receiver.
Error Control: DLL adds reliability to PLL by adding mechanism to detect and transmit damaged frames or lost frames. Error control is achieved through a trailer added to end of the fame
Access Control: When two or more devices are connected to the same link, DLL protocols are necessary to determine which device has control over the link at any given time.
Access Control: When two or more devices are connected to the same link, DLL protocols are necessary to determine which device has control over the link at any given time.
Hop to hop delivery
Unit - 4
Link Layer ServicesLink Layer Services
Framing, link access: encapsulate datagram into frame, adding header, trailer channel access if shared medium “MACMAC” addresses used in frame headers to identify
source, dest • different from IP address!different from IP address!
Reliable delivery between adjacent adjacent nodes we learned how to do this already (chapter 3)! seldom used on low bit error link (fiber, some twisted pair) wireless links: high error rates
• Q: why both link-level and end-end reliability?
48 bit address48 bit address
Unit - 4
Flow Control: pacing between adjacent sending and receiving nodes
Error Detection: errors caused by signal attenuation, noise. receiver detects presence of errors:
• signals sender for retransmission or drops frame
Error Correction: receiver identifies and corrects bit error(s) without
resorting to retransmission
Half-duplex and full-duplex with half duplex, nodes at both ends of link can transmit,
but not at same time
Unit - 4
Adaptors CommunicatingAdaptors Communicating
link layer implemented in “adaptor” (aka NICNIC) Ethernet card, PCMCI card,
802.11 card sending side:
encapsulates datagram in a frame
adds error checking bits, rdt, flow control, etc.
receiving side looks for errors, rdt, flow
control, etc extracts datagram, passes to
rcving node
adapter is semi-autonomoussemi-autonomous link & physical layers
sendingnode
frame
rcvingnode
datagram
frame
adapter adapter
link layer protocol
Unit - 4
Error DetectionError DetectionEDC=EDC= EError DDetection and CCorrection bits (redundancy)DD = Data protected by error checking, may include header fields
• Error detection not Error detection not 100%100% reliable! reliable!• protocol may miss some errors, but rarely• larger EDC field yields better detection and correction
Unit - 4
Parity CheckingParity Checking
Single Bit Parity:Detect single bit errors
Two Dimensional Bit Parity:Detect and correct single bit errors
0 0
Unit - 4
Internet checksumInternet checksum
Goal: detect “errors” (e.g., flipped bits) in transmitted segment (note: used at transport layer only)
Unit - 4
Checksumming: Cyclic Redundancy CheckChecksumming: Cyclic Redundancy Check
view data bits, D, as a binary number choose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that
<D,R> exactly divisible by G (modulo 2) receiver knows G, divides <D,R> by G. If non-zero
remainder: error detected! can detect all burst errors less than r+1 bits
widely used in practice (ATM, HDCL)
Unit - 4
CRC ExampleCRC Example
Want:
D.2r XORXOR R = nG
equivalently:
D.2r = nG XORXOR R
equivalently:
if we divide D.2r by G, want remainder R
R = remainder[ ]D.2r
G
Unit - 4
Multiple Access Links and ProtocolsMultiple Access Links and ProtocolsTwo types of “links”: point-to-point
PPP for dial-up access point-to-point link between Ethernet switch and
host broadcast (shared wire or medium)
traditional Ethernet upstream HFC 802.11 wireless LAN
Transmission freq is differentdifferent from receiving frequency.
Unit - 4
Slotted ALOHASlotted 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 slot
if collision, node retransmits frame in each subsequent slot with prob. p until success
Unit - 4
Slotted ALOHASlotted 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 synchronizationclock synchronization
Unit - 4
Slotted Aloha efficiencySlotted Aloha efficiency
Suppose N nodes with many frames to send, each transmits in slot with probability p
prob that node 1 has success in a slot = p(1-p)N-1
prob that any node has a success = Np(1-p)N-1
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
At best: channelused for useful transmissions 37% of time!
Unit - 4
Pure (unslotted) ALOHAPure (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,t0+1]
Unit - 4
CSMACSMA(Carrier Sense Multiple Access)(Carrier Sense Multiple Access)
CSMA:
listen before transmit:If channel sensed idle: transmit entire frame
If channel sensed busy, defer transmission Human analogy: don’t interrupt others!
Unit - 4
CSMA(Carrier Sense Multiple Access)
Medium (channel) is shared by all stations.
And
Only one station at a time can use it.
All stations receive a frame frame sent by a station (broadcast)
The real destination keeps it while others DROP it.
Minimum frame length / Transmission rateMinimum frame length / Transmission rate
is proportional tois proportional to
collision domain / propagation speedcollision domain / propagation speed
Exponential back off policyExponential back off policy
Unit - 4
CSMA collisionsCSMA collisions
collisions can still occur:propagation delay means two nodes may not heareach other’s transmission
collision:entire packet transmission time wasted
spatial layout of nodes
note:role of distance & propagation delay in determining collision probability
Unit - 4
CSMA/CD CSMA/CD (Collision Detection)(Collision Detection)
CSMA/CD: carrier sensing, deferral as in CSMA collisions detected within short time colliding transmissions aborted, reducing channel
wastage collision detection:
easy in wired LANs: measure signal strengths, compare transmitted, received signals
difficult in wireless LANsdifficult in wireless LANs: receiver shut off while transmitting
human analogy: the polite conversationalist
Unit - 4
““Taking Turns” MAC protocolsTaking Turns” MAC protocols
Polling: master node “invites”
slave nodes to transmit in turn
concerns: polling overhead latency single point of failure
(master)
Token passing: control token passed from
one node to next sequentially. token message concerns:
token overhead latency single point of failure (token)
Unit - 4
Summary of MAC protocolsSummary of MAC protocols What do you do with a shared media?What do you do with a shared media?
Channel Partitioning, by time, frequency or codeChannel Partitioning, by time, frequency or code• Time Division, Frequency Division
Random partitioning (dynamic), Random partitioning (dynamic), • ALOHA, S-ALOHA, CSMA, CSMA/CD• carrier sensing: easy in some technologies (wire),
hard in others (wireless)• CSMA/CD used in Ethernet• CSMA/CA used in 802.11
Taking TurnsTaking Turns• polling from a central site, token passing
Unit - 4
What Is a MACMAC Address?The MAC address is a unique value associated with a network adapter. MAC addresses are also known as hardware addresseshardware addresses or physical addressesphysical addresses. They uniquely identify an adapter on a LAN.They uniquely identify an adapter on a LAN.
MAC addresses are 12-digit hexadecimal numbers(48 bits in length).
MAC addresses are usually written in one of the following two formats:MM:MM:MM:SS:SS:SS ororMM-MM-MM-SS-SS-SS
The first half of a MAC addressThe first half of a MAC address contains the ID number of the adapter manufacturer. (vendor)The second half of a MAC addressThe second half of a MAC address represents the serial number assigned to the adapter by the manufacturer.
C:>ipconfigC:>ipconfig
$ifconfig$ifconfig
Unit - 4
MAC AddressesMAC Addresses and ARP and ARP
32-bit IP address: network-layer address used to get datagram to destination IP subnet
48-bit MAC address: (or LAN or physical or Ethernet)
used to get datagram from one interface to another physically-connected interface (same network)
48 bit MAC address (for most LANs) burned in the adapter ROM
Logical AddressPhysical Address
Unit - 4
Learn aboutCommands
arpnetstatroute ipconfig
etc…
Unit - 4
LAN Addresses and ARPLAN Addresses and ARP
Each adapter on LAN has unique LAN address
Broadcast address =FF-FF-FF-FF-FF-FF
= adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
Hexadecimal
Unit - 4
MAC address allocation administered by IEEE manufacturer buys portion of MAC address space
(to assure uniqueness) Analogy:
(a) MAC address: like Social Security Number
(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
LAN Addresses
Unit - 4
ARPARPAddress Resolution ProtocolAddress Resolution Protocol
Each IP node (Host, Router) on LAN has ARP table
ARP Table: IP/MAC address mappings for some LAN nodes
< IP address; MAC address; TTL> TTL (Time To Live): time
after which address mapping will be forgotten (typically 20 min)
Question: how to determineMAC address of Bknowing B’s IP address?
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
237.196.7.23
237.196.7.78
237.196.7.14
237.196.7.88
Unit - 4
A wants to send datagram to B, and B’s MAC address not in A’s ARP table.
A broadcasts ARP query packet, containing B's IP address 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 A’s MAC
address (unicast)
A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) 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
ARPARPAddress Resolution Protocol
Unit - 4
Routing to another LANRouting to another LAN
walkthrough: send datagram from A to B via R assume A know’s B IP address
Two ARP tables in router R, one for each IP network (LAN)
In routing table at source Host, find router 111.111.111.110 In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc
A
RB
Unit - 4
A creates datagram with source A, destination B A uses ARP to get R’s MAC address for 111.111.111.110A uses ARP to get R’s MAC address for 111.111.111.110 A creates link-layer frame with R's MAC address as dest,
frame contains A-to-B IP datagram A’s adapter sends frame R’s adapter receives frame R removes IP datagram from Ethernet frame, sees its R removes IP datagram from Ethernet frame, sees its
destined to Bdestined to B R uses ARP to get B’s MAC address R creates frame containing A-to-B IP datagram sends to B
A
RB
Unit - 4
EthernetEthernet“dominant” wired LAN technology: cheap $20 for 100Mbs! first widely used LAN technology Simpler, cheaper than token LANs and ATM Kept up with speed race: 10 Mbps – 10
Gbps
Metcalfe’s Ethernetsketch
Read his inspiring Interview At the end of chapter
Unit - 4
Ethernet
The Preambleconsists of seven bytes all of the form 10101010, and is used by the receiver to allow it to establish bit
synchronisation (there is no clocking information on the Ether when nothing is being sent).
The Start frame delimiteris a single byte, 10101011, which is a frame flag, indicating the start of a frame.
The MAC addressesare always 48 bits long
The Length/EtherType field is the only one which differs between 802.3 and Ethernet II. In 802.3 it indicates the number of bytes of data in the frames payload, and can be anything from 0 to 1500
bytes.
Frames must be at least 64 bytes long, not including the preamble, so, if the data field is shorter than 46 bytes, it must be compensated by the Pad field.Pad field.
The reason for specifying a minimum length lies with the collision-detect mechanism. In CSMA/CD a station must never be allowed to believe it has transmitted a frame successfully if that frame has, in fact, experienced a collision.
Unit - 4
Ethernet uses Ethernet uses CSMA/CDCSMA/CD
No slots adapter doesn’t transmit if
it senses that some other adapter is transmitting, that is, carrier sense
transmitting adapter aborts when it senses that another adapter is transmitting, that is, collision detection
Before attempting a retransmission, adapter waits a random time, that is, random access
Unit - 4
CSMA/CD efficiencyCSMA/CD efficiency
Tprop = max prop between 2 nodes in LAN ttrans = time to transmit max-size frame
Efficiency goes to 1 as tprop goes to 0 Goes to 1 as ttrans goes to infinity Much better than ALOHA, but still decentralized,
simple, and cheap
transprop tt /51
1efficiency
Unit - 4
10BaseT and 100BaseT10BaseT and 100BaseT 10/100 Mbps rate; latter called “fast ethernet” T stands for Twisted Pair Nodes connect to a hub: “star topology”; 100
m max distance between nodes and hub
twisted pair
hub
Unit - 4
HubsHubsHubs are essentially physical-layer repeaters:
bits coming from one link go out all other links at the same rate no frame buffering no CSMA/CD at hub: adapters detect collisions provides net management functionality
twisted pair
hub
Unit - 4
Manchester encodingManchester encoding
Used in 10BaseT Each bit has a transition Allows clocks in sending and receiving nodes to
synchronize to each other no need for a centralized, global clock among nodes!
Hey, this is physical-layer stuff!
RLLRLL??
encodingencoding??
Unit - 4
Gbit EthernetGbit Ethernet
uses standard Ethernet frame format allows for point-to-point links and shared broadcast
channels in shared mode, CSMA/CD is used; short distances
between nodes required for efficiency uses hubs, called here “Buffered Distributors” Full-Duplex at 1 Gbps for point-to-point links 10 Gbps now !
Unit - 4
Interconnecting with hubsInterconnecting with hubs Backbone hub interconnects LAN segments Extends max distance between nodes But individual segment collision domains become one large
collision domain Can’t interconnect 10BaseT & 100BaseT
hub
hubhub
hub
Unit - 4
SwitchSwitch
Link layer devicestores and forwards Ethernet framesexamines frame header and selectively
forwards frame based on MAC dest addresswhen frame is to be forwarded on segment,
uses CSMA/CD to access segment transparent
hosts are unaware of presence of switchesplug-and-play, self-learning
switches do not need to be configured
Unit - 4
ForwardingForwarding
• How do determine onto which LAN segment to How do determine onto which LAN segment to forward frame?forward frame?• Looks like a routing problem...
hub
hubhub
switch1
2 3
Unit - 4
Self learningSelf learning
A switch has a switch table entry in switch table:
(MAC Address, Interface, Time Stamp) stale entries in table dropped (TTL can be 60 min)
switch learns which hosts can be reached through which interfaces when frame received, switch “learns” location of
sender: incoming LAN segment records sender/location pair in switch table
Unit - 4
Filtering/ForwardingFiltering/Forwarding
When switch receives a frame:
index switch table using MAC dest addressif entry found for destination
then{ if dest on segment from which frame arrived
then drop the frame else forward the frame on interface indicated } else flood
forward on all but the interface on which the frame arrived
Unit - 4
Switch exampleSwitch example
Suppose C sends frame to D
Switch receives frame from from C notes in bridge table that C is on interface 1 because D is not in table, switch forwards frame into interfaces
2 and 3
frame received by D
hub
hub hub
switch
A
B CD
EF
G H
I
address interface
ABEG
1123
12 3
Unit - 4
Suppose D replies back with frame to C.
Switch receives frame from from D notes in bridge table that D is on interface 2 because C is in table, switch forwards frame only to interface 1
frame received by C
hub
hub hub
switch
A
B CD
EF
G H
I
address interface
ABEGC
11231
Switch exampleSwitch example
Unit - 4
Switch: traffic isolationSwitch: traffic isolation switch installation breaks subnet into LAN segments switch filters packets:
same-LAN-segment frames not usually forwarded onto other LAN segments
segments become separate collision domains
hub hub hub
switch
collision domain collision domain
collision domain
Unit - 4
Institutional networkInstitutional network
hub
hubhub
switch
to externalnetwork
router
IP subnet
mail server
web server
Unit - 4
WANWAN LANLAN
n e t l a b n e t l a b I N F R A S T R U C T U R E I N F R A S T R U C T U R E
Atire WireSpan 5000 Modem V.35
Atire WireSpan 5000 SERVER ROOM
DATA CENTER
NetLinkG.703/G.7042701 PATTONModemBSNL TOWER
SHEGAONSSGMCE
BSNLKHAMGAON
OFC (FIBER OPTIC CABLE)Distance 20 KM
RASCISCO 5300
CISCO 7500
CISCO 2620ROUTER
42U Switch & Server Racks SSGMCE
CAMPUS
1 2 3 4 5 61 2 3 4 5 6
1]1] Traffic Monitoring Server2]2] DNS (Secondary NS2)
Server3]3] Proxy & Dial-in Server4]4] WWW & POP Server5]5] DNS (Primary NS1) & Mail6]6] DHCP+FTP Server
T&PEPABXDIAL INSERVICE
GMSENGLIS
HSCHOO
L
Unit - 4
n e t l a b n e t l a b I N F R A S T R U C T U R E I N F R A S T R U C T U R E
DWL-2100APD-Link
Atire WireSpan 5000 Modem V.35
Atire WireSpan 5000
EXTCMECHSAP-LAB
SGIRCNEW ADMIN BUILDING
ELECT
SM1LADIESHOSTEL
MBADEPARTMENT
SVBOYSHOSTEL
GMSENGSCHOOL
NetLinkG.703/G.7042701 PATTONModem
RASCISCO 5300
CISCO 7500
BSNL TOWERSHEGAONSSGMCE
BSNL KHAMGAON
T&PEPABXDIAL INSERVICE
DWL-2100APD-Link
Wi-FiFacility
6 CORE FIBER
UTP
Layer II/III switch
OFCSWITCH/ SERVER RACK
SERVER ROOMDATA CENTER
CENTRALLIBRARYBUILDING2000 MTRS FIBER 2000 MTRS FIBER
COVERS EACH CORNER OFCOVERS EACH CORNER OFSSGMCESSGMCE
N
E
Unit - 4
MBA DEPT12U-Rack
192.168.254.10
ELECTRONICS DEPARTMENT
12U-Rack
3300TM (24)
ELECTRICAL DEPARTMENT
9U-Rack
D-Link 1024D (24)
42U- RACK
3COM3300MM (24)
3COM 4050 (12)
3COM3300XM (24)
3COM3300MM (24)
3COM3300TM (24)
3COM3300XM (24)
3COM3300XM (24)
3COM3300XM (24)
3300SM (24)
CENTRALLIBRARY9U-Rack
MECHANICAL& GEN ENGG
DEPARTMENT12U-Rack
3300TM (24)
4226 (24)
4226 (24)
4226 (24)
Cisco2950 (12)
DES 1016D (16)
6 Core OFC 1000BASE-SXCAT-5
SERVER ROOM42U-RackCISCO 2620
192.168.254.14
192.168.254.16
192.168.254.14
192.168.254.12
192.168.254.17
192.168.254.18
192.168.254.13
4226
4226
4226
4228T
4226 (24)192.168.254.47
GIRLS HOSTEL12U-Rack
SV BOYS HOSTEL12U-Rack
GMS SHCOOL12U-Rack DETAILEDDETAILED
VIEWVIEW
Unit - 4
DEV QAS PRD
All Rack Mounted Servers
SAP ROUTER
SSGMCE CampusBuilding roof GMS
Building roof
Arial Distance 3 +/- KM
EXTERNAL WORLD
INTERNET
SSGMCESSGMCEWANWAN
SSGMCE INTRANET
LAN-1
N E T L A Bdata center
GMSBuildingComplex
GMS/SSGMCEGMS/SSGMCE INTRANETINTRANET
LAN-2LAN-2
TH
RE
E S
YS
TE
M S
AP
R/3
TH
RE
E S
YS
TE
M S
AP
R/3
LA
ND
SC
AP
EL
AN
DS
CA
PE
Motorola Canopy (Dish)Motorola Canopy (Dish)RF Point to Point Access PointRF Point to Point Access Point
Unit - 4
DEV QAS PRD
All Rack Mounted Servers
SSGMCE CampusBuilding roof
SAP ROUTER
3 KM
INTERNET
SSGMCEWAN
SSGMCE INTRANE
T
ANAND SAGAR
OTHERSCHOOLS
ANAND SAGAR OFFICE
GMSGMS
NEXT PHASEPROJECTPROJECTEXPANSION PLANEXPANSION PLAN
Remote Branches
ALANDI
Remote Branches
PANDHARPUR
Remote Branches
TRAMBK’WAR
Remote Branches
OMKARESHWAR
Unit - 4
Switches vs. RoutersSwitches vs. Routers both store-and-forward devices
routers: network layer devices (examine network layer headers) switches are link layer devices
routers maintain routing tables, implement routing algorithms switches maintain switch tables, implement filtering, learning
algorithms
Unit - 4
Summary comparisonSummary comparison
hubs routers switches
traffi c isolation
no yes yes
plug & play yes no yes
optimal routing
no yes no
cut through
yes no yes
Unit - 4
Point to Point Data Link ControlPoint to Point Data Link Control
one sender, one receiver, one link: easier than one sender, one receiver, one link: easier than broadcast link:broadcast link: no Media Access Control no need for explicit MAC addressing e.g., dialup link, ISDN line
popular point-to-point DLC protocols: PPPPPP (point-to-point protocol) HDLCHDLC: High level data link control (Data link used
to be considered “high layer” in protocol stack!
High-Level Data Link ControlHigh-Level Data Link Control
Unit - 4
PPP Design Requirements [RFC 1557]PPP Design Requirements [RFC 1557]
packet framing: encapsulation of network-layer encapsulation of network-layer datagram in data link framedatagram in data link frame carry network layer data of any network layer
protocol (not just IP) at same time ability to demultiplex upwards
bit transparency: must carry any bit pattern in the data field
error detection (no correction) connection liveness: detect, signal link failure to
network layer network layer address negotiation: endpoint can
learn/configure each other’s network address
Unit - 4
PPP non-requirementsPPP non-requirements
no error correction/recovery no flow control out of order delivery OK no need to support multipoint links (e.g., polling)
Error recovery, flow control, data re-ordering Error recovery, flow control, data re-ordering all relegated to all relegated to higher layershigher layers!!
Unit - 4
PPP Data FramePPP Data Frame
Flag: delimiter (framing) Address: does nothing (only one option) Control: does nothing; in the future possible multiple
control fields Protocol: upper layer protocol to which frame
delivered (eg, PPP-LCP, IP, IPCP, etc)
Unit - 4
PPP Data FramePPP Data Frame
info: upper layer data being carried check: cyclic redundancy check for error
detection
Unit - 4
Byte StuffingByte Stuffing “data transparency” requirement: data field must be
allowed to include flag pattern <01111110> Q: is received <01111110> data or flag?
Sender: adds (“stuffs”) extra < 01111110> byte after each < 01111110> data byte
Receiver: two 01111110 bytes in a row: discard first byte,
continue data reception single 01111110: flag byte
Unit - 4
Byte StuffingByte Stuffing
flag bytepatternin datato send
flag byte pattern plusstuffed byte in transmitted data
Unit - 4
PPP Data Control ProtocolPPP Data Control Protocol
Before exchanging network-layer data, data link peers must
configure PPP link (max. frame length, authenticationauthentication)
learn/configure network layer information
for IP: carry IP Control Protocol (IPCP) msgs (protocol field: 8021) to configure/learn IP address
Unit - 4
Unit - 4
MultimediaMultimedia
In past, we listened to audio/video broadcast through a radio or TV transmission.
But now time has changedAudio and Video services are divided into 3 categoriesAudio and Video services are divided into 3 categories
1. Streaming stored audio/video2. Streaming live audio/video and3. Interactive stored audio/video
Streaming –Streaming –Means a user can listen (or watch) the file after downloading has stored.
Unit - 4
Multimedia, Quality of Service: Multimedia, Quality of Service: What is it?What is it?
Multimedia applications: network audio and video(“continuous media”)
network provides application with level of level of performance needed for performance needed for application to function.application to function.
QoS
Unit - 4
MM Networking Applications MM Networking Applications
Fundamental Fundamental characteristics:characteristics:
Typically delay sensitive end-to-end delay delay jitter
But loss tolerant: infrequent losses cause minor glitches
Antithesis of data, which are loss intolerant but delay tolerant.
Classes of MM Classes of MM applications:applications:
1) Streaming stored audio and video
2) Streaming live audio and video
3) Real-time interactive audio and video
JitterJitter is the variability of packet delays within the same packet stream
Unit - 4
Streaming Stored Multimedia Streaming Stored Multimedia
Streaming: media stored at source transmitted to client streamingstreaming: client playout begins
before all data has arrived
timing constraint for still-to-be transmitted data: in time for playout
Unit - 4
StreamingStreaming Stored Multimedia: What is it? Stored Multimedia: What is it?
1. videorecorded
2. videosent
3. video received,played out at client
Cum
ula
tive
data
streaming:streaming: at this time, client playing out early part of video, while server still sending laterpart of video
networkdelay
time
Unit - 4
StreamingStreaming Stored Multimedia: Interactivity Stored Multimedia: Interactivity
VCR-like functionality: client can pause, rewind, FF, push slider bar 10 sec initial delay OK 1-2 sec until command effect OK RTSP often used (more later)
timing constraint for still-to-be transmitted data: in time for playout
Unit - 4
Streaming Live MultimediaStreaming Live Multimedia
Examples: Internet radio talk show Live sporting event
Streaming playback buffer playback can lag tens of seconds after transmission still have timing constraint
Interactivity fast forward impossible rewind, pause possible!
Unit - 4
Multimedia Over Today’s InternetMultimedia Over Today’s Internet
TCP/UDP/IP: “best-effort service” no guarantees on delay, loss
Today’s Internet multimedia applications use application-level techniques to mitigate
(as best possible) effects of delay, loss
But you said multimedia apps requiresQoS and level of performance to be
effective!
?? ???
?
? ??
?
?
Unit - 4
about about audio compressionaudio compression
Analog signal sampled at constant rate telephone: 8,000
samples/sec CD music: 44,100
samples/sec Each sample quantized,
i.e., rounded e.g., 28=256 possible
quantized values Each quantized value
represented by bits 8 bits for 256 values
Example: 8,000 samples/sec, 256 quantized values --> 64,000 bps
Receiver converts it back to analog signal: some quality reduction
Example ratesExample rates CD: 1.411 Mbps MP3: 96, 128, 160
kbps Internet telephony:
5.3 - 13 kbps
Unit - 4
about video compressionabout video compression
Video is sequence of images displayed at constant rate e.g. 24 images/sec
Digital image is array of pixels
Each pixel represented by bits
Redundancy spatial temporal
Examples: MPEG 1 (CD-ROM)
1.5 Mbps MPEG2 (DVD) 3-6
Mbps MPEG4 (often used in
Internet, < 1 Mbps)
Unit - 4
Streaming Multimedia: Streaming Multimedia: UDP UDP oror TCP TCP??UDP server sends at rate appropriate for client (oblivious to network congestion !)
often send rate = encoding rate = constant rate then, fill rate = constant rate - packet loss
short playout delay (2-5 seconds) to compensate for network delay jitter error recover: time permitting
TCP send at maximum possible rate under TCP fill rate fluctuates due to TCP congestion control larger playout delay: smooth TCP delivery rate HTTP/TCP passes more easily through firewalls
Unit - 4
RTSP RTSP
HTTP Does not target multimedia
content No commands for fast
forward, etc.
RTSP: RFC 2326 Client-server application
layer protocol. For user to control display:
rewind, fast forward, pause, resume, repositioning, etc…
What it doesn’t do: does not define how does not define how
audio/video is audio/video is encapsulated for encapsulated for streaming over networkstreaming over network
does not restrict how streamed media is transported; it can be transported over UDP or TCP
does not specify how the does not specify how the media player buffers media player buffers audio/videoaudio/video
Unit - 4
Using a Media Server and RTSPRTSP
The real-time streaming Protocol (RTSPRTSP):
Is control protocol designed to add more functionalities to the streaming process.
Using RTSP we can control the playing of audio/video.
RTSP is a out-of-band control protocol that is similar to the second connection in FTP.
Unit - 4
Using a Media Server and RTSPRTSP
Browser
Client Machine Server Machine
Web Server
1
2
GET: metafile
Response
MediaPlayer
3
MediaServer
4 SETUP
5 RESPONSE
6 PLAY
7 RESPONSE
8 TEARDOWN
9 RESPONSE
Unit - 4
RTSP: out of band controlRTSP: out of band controlFTP uses an “out-of-band”
control channel: A file is transferred over
one TCP connection. Control information
(directory changes, file deletion, file renaming, etc.) is sent over a separate TCP connection.
The “out-of-band” and “in-band” channels use different port numbers.
RTSP messages are also sent out-of-band:
RTSP control messages use different port numbers than the media stream: out-of-band. Port 554
The media stream is considered “in-band”.
Unit - 4
RTSP ExampleRTSP Example
Scenario: metafile communicated to web browser browser launches player player sets up an RTSP control connection,
data connection to streaming server
Unit - 4
Metafile ExampleMetafile Example<title>Twister</title> <session> <group language=en lipsync> <switch> <track type=audio e="PCMU/8000/1" src = "rtsp://audio.example.com/twister/audio.en/lofi"> <track type=audio e="DVI4/16000/2" pt="90 DVI4/8000/1" src="rtsp://audio.example.com/twister/audio.en/hifi"> </switch> <track type="video/jpeg" src="rtsp://video.example.com/twister/video"> </group> </session>
Unit - 4
RTSP OperationRTSP Operation
Unit - 4
RTSP Exchange ExampleRTSP Exchange Example C: SETUP rtsp://audio.example.com/twister/audio RTSP/1.0 Transport: rtp/udp; compression; port=3056; mode=PLAY
S: RTSP/1.0 200 1 OK Session 4231
C: PLAY rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Session: 4231 Range: npt=0-
C: PAUSE rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Session: 4231 Range: npt=37
C: TEARDOWN rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Session: 4231
S: 200 3 OK
Unit - 4
Real-time interactive Real-time interactive applicationsapplications
PC-2-PC phone instant messaging services
are providing this PC-2-phone
Dialpad Net2phone
videoconference with Webcams
Going to now look at a PC-2-PC Internet phone example in detail
Unit - 4
InteractiveInteractive Multimedia: Internet Multimedia: Internet PhonePhone
Introduce Internet Phone by way of an example
speaker’s audio: alternating talk spurts, silent periods. 64 kbps during talk spurt
pkts generated only during talk spurts 20 msec chunks at 8 Kbytes/sec: 160 bytes data
application-layer header added to each chunk.
Chunk+header encapsulated into UDP segment.
application sends UDP segment into socket every 20 msec during talkspurt.
Unit - 4
Internet Phone: Packet Loss and DelayInternet Phone: Packet Loss and Delay
network loss: IP datagram lost due to network congestion (router buffer overflow)
delay loss: IP datagram arrives too late for playout at receiver delays: processing, queueing in network; end-
system (sender, receiver) delays typical maximum tolerable delay: 400 ms
loss tolerance: depending on voice encoding, losses concealed, packet loss rates between 1% and 10% can be tolerated.
Unit - 4
constant bit ratetransmission
Cum
ula
tive
data
time
variablenetwork
delay(jitter)
clientreception
constant bit rate playout at client
client playoutdelay
bu
ffere
ddata
Delay JitterDelay Jitter
Consider the end-to-end delays of two consecutive packets: difference can be more or less than 20 msec
Unit - 4
Internet Phone: Fixed Playout DelayInternet Phone: Fixed Playout Delay
Receiver attempts to playout each chunk exactly q msecs after chunk was generated.chunk has time stamp t: play out chunk at
t+q .chunk arrives after t+q: data arrives too
late for playout, data “lost” Tradeoff for q:
large q: less packet losssmall q: better interactive experience
Unit - 4
Fixed Playout DelayFixed Playout Delay
packets
tim e
packetsgenerated
packetsreceived
loss
r
p p '
playout schedulep' - r
playout schedulep - r
• Sender generates packets every 20 msec during talk spurt.• First packet received at time r• First playout schedule: begins at p• Second playout schedule: begins at p’
Unit - 4
Adaptive Playout Delay, IAdaptive Playout Delay, I
packetith receivingafter delay network average of estimated
acketpith for delay network tr
receiverat played is ipacket timethep
receiverby received is ipacket timether
packetith theof timestampt
i
ii
i
i
i
Dynamic estimate of average delay at receiver:
)()1( 1 iiii trudud
where u is a fixed constant (e.g., u = .01).
Goal: minimize playout delay, keeping late loss rate low Approach: adaptive playout delay adjustment:
Estimate network delay, adjust playout delay at beginning of each talk spurt.
Silent periods compressed and elongated. Chunks still played out every 20 msec during talk spurt.
Unit - 4
Adaptive playout delay IIAdaptive playout delay II
Also useful to estimate the average deviation of the delay, vi :
||)1( 1 iiiii dtruvuv
The estimates di and vi are calculated for every received packet, although they are only used at the beginning of a talk spurt.
For first packet in talk spurt, playout time is:
iiii Kvdtp
where K is a positive constant.
Remaining packets in talkspurt are played out periodically
Unit - 4
Adaptive Playout, IIIAdaptive Playout, III
Q: How does receiver determine whether packet is first in a talkspurt?
If no loss, receiver looks at successive timestamps. difference of successive stamps > 20 msec -->talk
spurt begins. With loss possible, receiver must look at both
time stamps and sequence numbers. difference of successive stamps > 20 msec and
sequence numbers without gaps --> talk spurt begins.
Unit - 4
Recovery from packet loss (1)Recovery from packet loss (1)
forward error correction (FEC): simple scheme
for every group of n chunks create a redundant chunk by exclusive OR-ing the n original chunks
send out n+1 chunks, increasing the bandwidth by factor 1/n.
can reconstruct the original n chunks if there is at most one lost chunk from the n+1 chunks
Playout delay needs to be fixed to the time to receive all n+1 packets
Tradeoff: increase n, less
bandwidth waste increase n, longer
playout delay increase n, higher
probability that 2 or more chunks will be lost
Unit - 4
Recovery from packet loss (2)Recovery from packet loss (2)2nd FEC scheme• “piggyback lower quality stream” • send lower resolutionaudio stream as theredundant information• for example, nominal stream PCM at 64 kbpsand redundant streamGSM at 13 kbps.
• Whenever there is non-consecutive loss, thereceiver can conceal the loss. • Can also append (n-1)st and (n-2)nd low-bit ratechunk
Unit - 4
Recovery from packet loss (3)Recovery from packet loss (3)
Interleaving chunks are broken
up into smaller units for example, 4 5 msec units
per chunk Packet contains small units
from different chunks
if packet is lost, still have most of every chunk
has no redundancy overhead
but adds to playout delay
Unit - 4
Summary: Summary: Internet Multimedia: bag of Internet Multimedia: bag of trickstricks
use UDP to avoid TCP congestion control (delays) for time-sensitive traffic
client-side adaptive playout delay: to compensate for delay
server side matches stream bandwidth to available client-to-server path bandwidth chose among pre-encoded stream rates dynamic server encoding rate
error recovery (on top of UDP) FEC, interleaving retransmissions, time permitting conceal errors: repeat nearby data
Unit - 4
Real-Time Protocol (RTP)Real-Time Protocol (RTP)
RTP specifies a packet structure for packets carrying audio and video data
RFC 1889. RTP packet provides
payload type identification
packet sequence numbering
timestamping
RTP runs in the end systems.
RTP packets are encapsulated in UDP segments
Interoperability: If two Internet phone applications run RTP, then they may be able to work together
Unit - 4
RTP runs on top of UDPRTP runs on top of UDP
RTP libraries provide a transport-layer interface that extend UDP:
• port numbers, IP addresses• payload type identification• packet sequence numbering• time-stamping
Unit - 4
RTP ExampleRTP Example Consider sending 64
kbps PCM-encoded voice over RTP.
Application collects the encoded data in chunks, e.g., every 20 msec = 160 bytes in a chunk.
The audio chunk along with the RTP header form the RTP packet, which is encapsulated into a UDP segment.
RTP header indicates type of audio encoding in each packet sender can change
encoding during a conference.
RTP header also contains sequence numbers and timestamps.
Unit - 4
RTP and QoSRTP and QoS
RTP does not provide any mechanism to ensure timely delivery of data or provide other quality of service guarantees.
RTP encapsulation is only seen at the end systems: it is not seen by intermediate routers. Routers providing best-effort service do not
make any special effort to ensure that RTP packets arrive at the destination in a timely matter.
Unit - 4
RTP HeaderRTP Header
Payload Type (7 bits): Indicates type of encoding currently being used. If sender changes encoding in middle of conference, sender informs the receiver through this payload type field.
•Payload type 0: PCM mu-law, 64 kbps•Payload type 3, GSM, 13 kbps•Payload type 7, LPC, 2.4 kbps•Payload type 26, Motion JPEG•Payload type 31. H.261•Payload type 33, MPEG2 video
Sequence Number (16 bits): Increments by one for each RTP packet sent, and may be used to detect packet loss and to restore packet sequence.
Unit - 4
RTP Header (2)RTP Header (2)
Timestamp field (32 bytes long). Reflects the sampling instant of the first byte in the RTP data packet. For audio, timestamp clock typically increments by
one for each sampling period (for example, each 125 usecs for a 8 KHz sampling clock)
if application generates chunks of 160 encoded samples, then timestamp increases by 160 for each RTP packet when source is active. Timestamp clock continues to increase at constant rate when source is inactive.
SSRC field (32 bits long). Identifies the source of the RTP stream. Each stream in a RTP session should have a distinct SSRC.
Unit - 4
RTSP/RTP Programming RTSP/RTP Programming AssignmentAssignment
Build a server that encapsulates stored video frames into RTP packets grab video frame, add RTP headers, create
UDP segments, send segments to UDP socket
include seq numbers and time stamps client RTP provided for you
Also write the client side of RTSP issue play and pause commands server RTSP provided for you
Unit - 4
Real-Time Control Protocol (RTCP)Real-Time Control Protocol (RTCP)
Works in conjunction with RTP.
Each participant in RTP session periodically transmits RTCP control packets to all other participants.
Each RTCP packet contains sender and/or receiver reports report statistics useful
to application
Statistics include number of packets sent, number of packets lost, interarrival jitter, etc.
Feedback can be used to control performance Sender may modify
its transmissions based on feedback
Unit - 4
RTCP - ContinuedRTCP - Continued
- For an RTP session there is typically a single multicast address; all RTP and RTCP packets belonging to the session use the multicast address.
- RTP and RTCP packets are distinguished from each other through the use of distinct port numbers.
- To limit traffic, each participant reduces his RTCP traffic as the number of conference participants increases.
Unit - 4
RTCP PacketsRTCP Packets
Receiver report packets: fraction of packets
lost, last sequence number, average interarrival jitter.
Sender report packets: SSRC of the RTP
stream, the current time, the number of packets sent, and the number of bytes sent.
Source description packets:
e-mail address of sender, sender's name, SSRC of associated RTP stream.
Provide mapping between the SSRC and the user/host name.
Unit - 4
Synchronization of StreamsSynchronization of Streams
RTCP can synchronize different media streams within a RTP session.
Consider videoconferencing app for which each sender generates one RTP stream for video and one for audio.
Timestamps in RTP packets tied to the video and audio sampling clocks not tied to the wall-
clock time
Each RTCP sender-report packet contains (for the most recently generated packet in the associated RTP stream): timestamp of the RTP
packet wall-clock time for when
packet was created. Receivers can use this
association to synchronize the playout of audio and video.
Unit - 4
RTCP Bandwidth ScalingRTCP Bandwidth Scaling
RTCP attempts to limit its traffic to 5% of the session bandwidth.
Example Suppose one sender,
sending video at a rate of 2 Mbps. Then RTCP attempts to limit its traffic to 100 Kbps.
RTCP gives 75% of this rate to the receivers; remaining 25% to the sender
The 75 kbps is equally shared among receivers: With R receivers, each
receiver gets to send RTCP traffic at 75/R kbps.
Sender gets to send RTCP traffic at 25 kbps.
Participant determines RTCP packet transmission period by calculating avg RTCP packet size (across the entire session) and dividing by allocated rate.
Unit - 4
SIPSIP
Session Initiation Protocol Comes from IETFSIP long-term vision All telephone calls and video conference
calls take place over the Internet People are identified by names or e-mail
addresses, rather than by phone numbers.
You can reach the callee, no matter where the callee roams, no matter what IP device the callee is currently using.
Unit - 4
SIP ServicesSIP Services
Setting up a call Provides mechanisms
for caller to let callee know she wants to establish a call
Provides mechanisms so that caller and callee can agree on media type and encoding.
Provides mechanisms to end call.
Determine current IP address of callee. Maps mnemonic
identifier to current IP address
Call management Add new media
streams during call Change encoding
during call Invite others Transfer and hold
calls
Unit - 4
Setting up a call to a known IP Setting up a call to a known IP addressaddress
• Alice’s SIP invite message indicates her port number & IP address. Indicates encoding that Alice prefers to receive (PCM ulaw)
• Bob’s 200 OK message indicates his port number, IP address & preferred encoding (GSM)
• SIP messages can be sent over TCP or UDP; here sent over RTP/UDP. •Default SIP port number is 5060.
time time
Bob'stermina l rings
A lice
167.180.112.24
Bob
193.64.210.89
port 38060
Law audio
G SMport 48753
Unit - 4
Setting up a call (more)Setting up a call (more) Codec negotiation:
Suppose Bob doesn’t have PCM ulaw encoder.
Bob will instead reply with 606 Not Acceptable Reply and list encoders he can use.
Alice can then send a new INVITE message, advertising an appropriate encoder.
Rejecting the call Bob can reject
with replies “busy,” “gone,” “payment required,” “forbidden”.
Media can be sent over RTP or some other protocol.
Unit - 4
Example of SIP messageExample of SIP message
INVITE sip:[email protected] SIP/2.0Via: SIP/2.0/UDP 167.180.112.24From: sip:[email protected]: sip:[email protected] Call-ID: [email protected]: application/sdpContent-Length: 885
c=IN IP4 167.180.112.24m=audio 38060 RTP/AVP 0Notes: HTTP message syntax sdp = session description protocol Call-ID is unique for every call.
• Here we don’t know Bob’s IP address. Intermediate SIPservers will be necessary.
• Alice sends and receives SIP messages using the SIP default port number 506.
• Alice specifies in Via:header that SIP client sends and receives SIP messages over UDP
Unit - 4
Name translation and user locataionName translation and user locataion
Caller wants to call callee, but only has callee’s name or e-mail address.
Need to get IP address of callee’s current host: user moves around DHCP protocol user has different IP
devices (PC, PDA, car device)
Result can be based on: time of day (work,
home) caller (don’t want boss to
call you at home) status of callee (calls
sent to voicemail when callee is already talking to someone)
Service provided by SIP servers:
SIP registrar server SIP proxy server
Unit - 4
SIP RegistrarSIP Registrar
REGISTER sip:domain.com SIP/2.0Via: SIP/2.0/UDP 193.64.210.89 From: sip:[email protected]: sip:[email protected]: 3600
When Bob starts SIP client, client sends SIP REGISTER message to Bob’s registrar server
(similar function needed by Instant Messaging)
Register Message:
Unit - 4
SIP ProxySIP Proxy
Alice sends invite message to her proxy server contains address sip:[email protected]
Proxy responsible for routing SIP messages to callee possibly through multiple proxies.
Callee sends response back through the same set of proxies.
Proxy returns SIP response message to Alice contains Bob’s IP address
Note: proxy is analogous to local DNS server
Unit - 4
ExampleExampleCaller [email protected] with places a call to [email protected]
(1) Jim sends INVITEmessage to umass SIPproxy. (2) Proxy forwardsrequest to upenn registrar server. (3) upenn server returnsredirect response,indicating that it should try [email protected]
(4) umass proxy sends INVITE to eurecom registrar. (5) eurecom registrar forwards INVITE to 197.87.54.21, which is running keith’s SIP client. (6-8) SIP response sent back (9) media sent directly between clients. Note: also a SIP ack message, which is not shown.
SIP client217.123.56.89
SIP client197.87.54.21
SIP proxyum ass.edu
SIP registrarupenn.edu
SIPregistrareurecom .fr
1
2
34
5
6
7
8
9
Unit - 4
Comparison with H.323Comparison with H.323
H.323 is another signaling protocol for real-time, interactive
H.323 is a complete, vertically integrated suite of protocols for multimedia conferencing: signaling, registration, admission control, transport and codecs.
SIP is a single component. Works with RTP, but does not mandate it. Can be combined with other protocols and services.
H.323 comes from the ITU (telephony).
SIP comes from IETF: Borrows much of its concepts from HTTP. SIP has a Web flavor, whereas H.323 has a telephony flavor.
SIP uses the KISS principle: Keep it simple stupid.
Unit - 4
Content distribution networks (CDNs)Content distribution networks (CDNs)
Content replication Challenging to stream large
files (e.g., video) from single origin server in real time
Solution: replicate content at hundreds of servers throughout Internet content downloaded to
CDN servers ahead of time
placing content “close” to user avoids impairments (loss, delay) of sending content over long paths
CDN server typically in edge/access network
origin server in North America
CDN distribution node
CDN serverin S. America CDN server
in Europe
CDN serverin Asia
Unit - 4
Content distribution networks (CDNs)Content distribution networks (CDNs)
Content replication CDN (e.g., Akamai)
customer is the content provider (e.g., CNN)
CDN replicates customers’ content in CDN servers. When provider updates content, CDN updates servers
origin server in North America
CDN distribution node
CDN serverin S. America CDN server
in Europe
CDN serverin Asia
Unit - 4
CDN exampleCDN example
origin server (www.foo.com) distributes HTML replaces: http://www.foo.com/sports.ruth.gif
with http://www.cdn.com/www.foo.com/sports/ruth.gif
HTTP request for
www.foo.com/sports/sports.html
DNS query for www.cdn.com
HTTP request for
www.cdn.com/www.foo.com/sports/ruth.gif
1
2
3
Origin server
CDNs authoritative DNS server
NearbyCDN server
CDN company (cdn.com) distributes gif files uses its authoritative
DNS server to route redirect requests
Unit - 4
More about CDNsMore about CDNs
routing requests CDN creates a “map”, indicating
distances from leaf ISPs and CDN nodes when query arrives at authoritative DNS
server: server determines ISP from which query
originates uses “map” to determine best CDN server
CDN nodes create application-layer overlay network
Unit - 4
Chapter 7 outlineChapter 7 outline 7.1 Multimedia
Networking Applications 7.2 Streaming stored
audio and video 7.3 Real-time
Multimedia: Internet Phone study
7.4 Protocols for Real-Time Interactive Applications RTP,RTCP,SIP
7.5 Distributing Multimedia: content distribution networks
7.6 Beyond Best Effort
7.7 Scheduling and Policing Mechanisms
7.8 Integrated Services and Differentiated Services
7.9 RSVP
Unit - 4
Improving QOS in IP NetworksImproving QOS in IP NetworksThus far: “making the best of best effort”Future: next generation Internet with QoS guarantees
RSVP: signaling for resource reservations Differentiated Services: differential guarantees Integrated Services: firm guarantees
simple model for sharing and congestion studies:
Unit - 4
Principles for QOS GuaranteesPrinciples for QOS Guarantees
Example: 1MbpsI P phone, FTP share 1.5 Mbps link. bursts of FTP can congest router, cause audio loss want to give priority to audio over FTP
packet marking needed for router to distinguish between different classes; and new router policy to treat packets accordingly
Principle 1
Unit - 4
Principles for QOS Guarantees Principles for QOS Guarantees (more)(more)
what if applications misbehave (audio sends higher than declared rate) policing: force source adherence to bandwidth allocations
marking and policing at network edge: similar to ATM UNI (User Network Interface)
provide protection (isolation) for one class from othersPrinciple 2
Unit - 4
Principles for QOS Guarantees Principles for QOS Guarantees (more)(more)
Allocating fixed (non-sharable) bandwidth to flow: inefficient use of bandwidth if flows doesn’t use its allocation
While providing isolation, it is desirable to use resources as efficiently as possible
Principle 3
Unit - 4
Principles for QOS Guarantees Principles for QOS Guarantees (more)(more)
Basic fact of life: can not support traffic demands beyond link capacity
Call Admission: flow declares its needs, network may block call (e.g., busy signal) if it cannot meet needs
Principle 4
Unit - 4
Summary of QoS Principles Summary of QoS Principles
Let’s next look at mechanisms for achieving this ….
Unit - 4
Scheduling And Policing Scheduling And Policing MechanismsMechanisms
scheduling: choose next packet to send on link FIFO (first in first out) scheduling: send in order of arrival to queue
real-world example? discard policy: if packet arrives to full queue: who to discard?
• Tail drop: drop arriving packet• priority: drop/remove on priority basis• random: drop/remove randomly
Unit - 4
Scheduling Policies: moreScheduling Policies: morePriority scheduling: transmit highest priority
queued packet multiple classes, with different priorities
class may depend on marking or other header info, e.g. IP source/dest, port numbers, etc..
Real world example?
Unit - 4
Scheduling Policies: still moreScheduling Policies: still moreround robin scheduling: multiple classes cyclically scan class queues, serving one from each class (if available) real world example?
Unit - 4
Scheduling Policies: still moreScheduling Policies: still more
Weighted Fair Queuing: generalized Round Robin each class gets weighted amount of
service in each cycle real-world example?
Unit - 4
Policing MechanismsPolicing MechanismsGoal: limit traffic to not exceed declared parametersThree common-used criteria: (Long term) Average Rate: how many pkts can be sent per unit
time (in the long run) crucial question: what is the interval length: 100 packets per sec or 6000
packets per min have same average! Peak Rate: e.g., 6000 pkts per min. (ppm) avg.; 1500 ppm peak
rate (Max.) Burst Size: max. number of pkts sent consecutively (with
no intervening idle)
Unit - 4
Policing MechanismsPolicing Mechanisms
Token Bucket: limit input to specified Burst Size and Average Rate.
bucket can hold b tokens tokens generated at rate r token/sec unless
bucket full over interval of length t: number of packets
admitted less than or equal to (r t + b).
Unit - 4
Policing Mechanisms (more)Policing Mechanisms (more)
token bucket, WFQ combine to provide guaranteed upper bound on delay, i.e., QoS guarantee!
WFQ
token rate, r
bucket size, b
per-flowrate, R
D = b/Rmax
arrivingtraffic
Unit - 4
Chapter 7 outlineChapter 7 outline 7.1 Multimedia
Networking Applications 7.2 Streaming stored
audio and video 7.3 Real-time
Multimedia: Internet Phone study
7.4 Protocols for Real-Time Interactive Applications RTP,RTCP,SIP
7.5 Distributing Multimedia: content distribution networks
7.6 Beyond Best Effort
7.7 Scheduling and Policing Mechanisms
7.8 Integrated Services and Differentiated Services
7.9 RSVP
Unit - 4
IETF Integrated ServicesIETF Integrated Services
architecture for providing QOS guarantees in IP networks for individual application sessions
resource reservation: routers maintain state info (a la VC) of allocated resources, QoS req’s
admit/deny new call setup requests:
Question: can newly arriving flow be admitted with performance guarantees while not violated QoS guarantees made to already admitted flows?
Unit - 4
Intserv: QoS guarantee scenarioIntserv: QoS guarantee scenario Resource reservation
call setup, signaling (RSVP) traffic, QoS declaration per-element admission control
QoS-sensitive scheduling (e.g.,
WFQ)
request/reply
Unit - 4
Call AdmissionCall Admission
Arriving session must : declare its QOS requirement
R-spec: defines the QOS being requested characterize traffic it will send into network
T-spec: defines traffic characteristics signaling protocol: needed to carry R-spec and
T-spec to routers (where reservation is required) RSVP
Unit - 4
Intserv QoS: Service models Intserv QoS: Service models [rfc2211, rfc [rfc2211, rfc 2212]2212]
Guaranteed service: worst case traffic arrival:
leaky-bucket-policed source simple (mathematically
provable) bound on delay [Parekh 1992, Cruz 1988]
Controlled load service: "a quality of service
closely approximating the QoS that same flow would receive from an unloaded network element."
WFQ
token rate, r
bucket size, b
per-flowrate, R
D = b/Rmax
arrivingtraffic
Unit - 4
IETF Differentiated ServicesIETF Differentiated ServicesConcerns with Intserv: Scalability: signaling, maintaining per-flow router state difficult with
large number of flows Flexible Service Models: Intserv has only two classes. Also want
“qualitative” service classes “behaves like a wire” relative service distinction: Platinum, Gold, Silver
Diffserv approach: simple functions in network core, relatively complex functions at edge
routers (or hosts) Do’t define define service classes, provide functional components to
build service classes
Unit - 4
Edge router: per-flow traffic
management
marks packets as in-profile and out-profile
Core router: per class traffic management buffering and scheduling
based on marking at edge preference given to in-profile
packets Assured Forwarding
Diffserv ArchitectureDiffserv Architecture
scheduling
...
r
b
marking
Unit - 4
Edge-router Packet MarkingEdge-router Packet Marking
class-based marking: packets of different classes marked differently
intra-class marking: conforming portion of flow marked differently than non-conforming one
profile: pre-negotiated rate A, bucket size B packet marking at edge based on per-flow profile
Possible usage of marking:
User packets
Rate A
B
Unit - 4
Classification and ConditioningClassification and Conditioning
Packet is marked in the Type of Service (TOS) in IPv4, and Traffic Class in IPv6
6 bits used for Differentiated Service Code Point (DSCP) and determine PHB that the packet will receive
2 bits are currently unused
Unit - 4
Classification and ConditioningClassification and Conditioning
may be desirable to limit traffic injection rate of some class:
user declares traffic profile (e.g., rate, burst size)
traffic metered, shaped if non-conforming
Unit - 4
Forwarding (PHB)Forwarding (PHB)
PHB result in a different observable (measurable) forwarding performance behavior
PHB does not specify what mechanisms to use to ensure required PHB performance behavior
Examples: Class A gets x% of outgoing link bandwidth
over time intervals of a specified length Class A packets leave first before packets
from class B
Unit - 4
Forwarding (PHB)Forwarding (PHB)
PHBs being developed: Expedited Forwarding: pkt departure
rate of a class equals or exceeds specified rate logical link with a minimum guaranteed rate
Assured Forwarding: 4 classes of traffic each guaranteed minimum amount of
bandwidth each with three drop preference partitions
Unit - 4
Chapter 7 outlineChapter 7 outline 7.1 Multimedia
Networking Applications 7.2 Streaming stored
audio and video 7.3 Real-time
Multimedia: Internet Phone study
7.4 Protocols for Real-Time Interactive Applications RTP,RTCP,SIP
7.5 Distributing Multimedia: content distribution networks
7.6 Beyond Best Effort
7.7 Scheduling and Policing Mechanisms
7.8 Integrated Services and Differentiated Services
7.9 RSVP
Unit - 4
Signaling in the InternetSignaling in the Internet
connectionless (stateless)
forwarding by IP routers
best effort service
no network signaling protocols
in initial IP design
+ =
New requirement: reserve resources along end-to-end path (end system, routers) for QoS for multimedia applications
RSVP: Resource Reservation Protocol [RFC 2205] “ … allow users to communicate requirements to
network in robust and efficient way.” i.e., signaling !
earlier Internet Signaling protocol: ST-II [RFC 1819]
Unit - 4
RSVP Design GoalsRSVP Design Goals
1. accommodate heterogeneous receivers (different bandwidth along paths)
2. accommodate different applications with different resource requirements
3. make multicast a first class service, with adaptation to multicast group membership
4. leverage existing multicast/unicast routing, with adaptation to changes in underlying unicast, multicast routes
5. control protocol overhead to grow (at worst) linear in # receivers
6. modular design for heterogeneous underlying technologies
Unit - 4
RSVP: does not…RSVP: does not… specify how resources are to be reserved
rather: a mechanism for communicating needs determine routes packets will take
that’s the job of routing protocolssignaling decoupled from routing
interact with forwarding of packetsseparation of control (signaling) and data
(forwarding) planes
Unit - 4
RSVP: overview of operationRSVP: overview of operation senders, receiver join a multicast group
done outside of RSVP senders need not join group
sender-to-network signaling path message: make sender presence known to routers path teardown: delete sender’s path state from routers
receiver-to-network signaling reservation message: reserve resources from sender(s)
to receiver reservation teardown: remove receiver reservations
network-to-end-system signaling path error reservation error
Unit - 4
Path msgs: RSVP Path msgs: RSVP sender-to-networksender-to-network signalingsignaling
path message contents: address: unicast destination, or multicast group flowspec: bandwidth requirements spec. filter flag: if yes, record identities of upstream
senders (to allow packets filtering by source) previous hop: upstream router/host ID refresh time: time until this info times out
path message: communicates sender info, and reverse-path-to-sender routing info later upstream forwarding of receiver
reservations
Unit - 4
RSVP: simple audio conferenceRSVP: simple audio conference
H1, H2, H3, H4, H5 both senders and receivers
multicast group m1 no filtering: packets from any sender
forwarded audio rate: b only one multicast routing tree possible
H2
H5
H3
H4H1
R1 R2 R3
Unit - 4
inout
inout
inout
RSVP: building up path stateRSVP: building up path state
H1, …, H5 all send path messages on m1:
(address=m1, Tspec=b, filter-spec=no-filter,refresh=100)
Suppose H1 sends first path message
H2
H5
H3
H4H1
R1 R2 R3L1
L2 L3
L4L5
L6 L7
L5 L7L6
L1L2 L6 L3
L7L4m1:
m1:
m1:
Unit - 4
inout
inout
inout
RSVP: building up path stateRSVP: building up path state
next, H5 sends path message, creating more state in routers
H2
H5
H3
H4H1
R1 R2 R3L1
L2 L3
L4L5
L6 L7
L5 L7L6
L1L2 L6 L3
L7L4
L5
L6L1
L6
m1:
m1:
m1:
Unit - 4
inout
inout
inout
RSVP: building up path stateRSVP: building up path state
H2, H3, H5 send path msgs, completing path state tables
H2
H5
H3
H4H1
R1 R2 R3L1
L2 L3
L4L5
L6 L7
L5 L7L6
L1L2 L6 L3
L7L4
L5
L6L1
L6L7
L4L3L7
L2m1:
m1:
m1:
Unit - 4
reservation msgs: reservation msgs: receiver-to-network receiver-to-network signalingsignaling
reservation message contents: desired bandwidth: filter type:
• no filter: any packets address to multicast group can use reservation
• fixed filter: only packets from specific set of senders can use reservation
• dynamic filter: senders who’s p[ackets can be forwarded across link will change (by receiver choce) over time.
filter spec reservations flow upstream from receiver-to-
senders, reserving resources, creating additional, receiver-related state at routers
Unit - 4
RSVP: RSVP: receiverreceiver reservation example reservation example 11
H1 wants to receive audio from all other senders
H1 reservation msg flows uptree to sources
H1 only reserves enough bandwidth for 1 audio stream
reservation is of type “no filter” – any sender can use reserved bandwidth
H2
H5
H3
H4H1
R1 R2 R3L1
L2 L3
L4L5
L6 L7
Unit - 4
inout
RSVP: RSVP: receiverreceiver reservation example reservation example 11
H1 reservation msgs flows uptree to sources
routers, hosts reserve bandwidth b needed on downstream links towards H1
H2
H5
H3
H4H1
R1 R2 R3L1
L2 L3
L4L5
L6 L7
L1L2 L6
L6L1(b)
inout
L5L6 L7
L7L5 (b)
L6
inout
L3L4 L7
L7L3 (b)
L4L2
b
bb
b
bb
b
m1:
m1:
m1:
Unit - 4
inout
RSVP: RSVP: receiverreceiver reservation example 1 reservation example 1 (more)(more)
next, H2 makes no-filter reservation for bandwidth b
H2 forwards to R1, R1 forwards to H1 and R2 (?)
R2 takes no action, since b already reserved on L6
H2
H5
H3
H4H1
R1 R2 R3L1
L2 L3
L4L5
L6 L7
L1L2 L6
L6L1(b)
inout
L5L6 L7
L7L5 (b)
L6
inout
L3L4 L7
L7L3 (b)
L4L2
b
bb
b
bb
b
b
b
(b)m1:
m1:
m1:
Unit - 4
inout
RSVP: RSVP: receiverreceiver reservation: issues reservation: issues
What if multiple senders (e.g., H3, H4, H5) over link (e.g., L6)?
arbitrary interleaving of packets L6 flow policed by leaky bucket: if H3+H4+H5
sending rate exceeds b, packet loss will occur
H2
H5
H3
H4H1
R1 R2 R3L1
L2 L3
L4L5
L6 L7
L1L2 L6
L6L1(b)
inout
L5L6 L7
L7L5 (b)
L6
inout
L3L4 L7
L7L3 (b)
L4L2
b
bb
b
bb
b
b
b
(b)m1:
m1:
m1:
Unit - 4
RSVP: example 2RSVP: example 2
H1, H4 are only senders send path messages as before, indicating
filtered reservation Routers store upstream senders for each
upstream link H2 will want to receive from H4 (only)
H2 H3
H4H1
R1 R2 R3L1
L2 L3
L4L6 L7
H2 H3
L2 L3
Unit - 4
RSVP: example 2RSVP: example 2 H1, H4 are only senders
send path messages as before, indicating filtered reservation
H2 H3
H4H1
R1 R3L1
L2 L3
L4L6 L7
H2 H3
L2 L3
L2(H1-via-H1 ; H4-via-R2 )L6(H1-via-H1 )L1(H4-via-R2 )
in
out
L6(H4-via-R3 )L7(H1-via-R1 )
in
out
L1, L6
L6, L7
L3(H4-via-H4 ; H1-via-R3 )L4(H1-via-R2 )L7(H4-via-H4 )
in
out
L4, L7
R2
Unit - 4
RSVP: example 2RSVP: example 2 receiver H2 sends reservation message for
source H4 at bandwidth b propagated upstream towards H4, reserving b
H2 H3
H4H1
R1 R3L1
L2 L3
L4L6 L7
H2 H3
L2 L3
L2(H1-via-H1 ;H4-via-R2 )L6(H1-via-H1 )L1(H4-via-R2 )
in
out
L6(H4-via-R3 )L7(H1-via-R1 )
in
out
L1, L6
L6, L7
L3(H4-via-H4 ; H1-via-R2 )L4(H1-via-62 )L7(H4-via-H4 )
in
out
L4, L7
R2
(b)
(b)
(b)
L1
bb b
b
Unit - 4
RSVP: RSVP: soft-statesoft-state senders periodically resend path msgs to refresh
(maintain) state receivers periodically resend resv msgs to refresh
(maintain) state path and resv msgs have TTL field, specifying
refresh interval
H2 H3
H4H1
R1 R3L1
L2 L3
L4L6 L7
H2 H3
L2 L3
L2(H1-via-H1 ;H4-via-R2 )L6(H1-via-H1 )L1(H4-via-R2 )
in
out
L6(H4-via-R3 )L7(H1-via-R1 )
in
out
L1, L6
L6, L7
L3(H4-via-H4 ; H1-via-R3 )L4(H1-via-62 )L7(H4-via-H4 )
in
out
L4, L7
R2
(b)
(b)
(b)
L1
bb b
b
Unit - 4
RSVP: RSVP: soft-statesoft-state suppose H4 (sender) leaves without performing teardown
H2 H3
H4H1
R1 R3L1
L2 L3
L4L6 L7
H2 H3
L2 L3
L2(H1-via-H1 ;H4-via-R2 )L6(H1-via-H1 )L1(H4-via-R2 )
in
out
L6(H4-via-R3 )L7(H1-via-R1 )
in
out
L1, L6
L6, L7
L3(H4-via-H4 ; H1-via-R3 )L4(H1-via-62 )L7(H4-via-H4 )
in
out
L4, L7
R2
(b)
(b)
(b)
L1
bb b
b
eventually state in routers will timeout and disappear!
gonefishing!
Unit - 4
The many uses of reservation/path The many uses of reservation/path refreshrefresh
recover from an earlier lost refresh message expected time until refresh received must be longer
than timeout interval! (short timer interval desired) Handle receiver/sender that goes away without
teardown Sender/receiver state will timeout and disappear
Reservation refreshes will cause new reservations to be made to a receiver from a sender who has joined since receivers last reservation refresh E.g., in previous example, H1 is only receiver, H3 only
sender. Path/reservation messages complete, data flows H4 joins as sender, nothing happens until H3 refreshes
reservation, causing R3 to forward reservation to H4, which allocates bandwidth
Unit - 4
RSVP: reflectionsRSVP: reflections
multicast as a “first class” service receiver-oriented reservations use of soft-state
Unit - 4
Multimedia Networking: SummaryMultimedia Networking: Summarymultimedia applications and
requirementsmaking the best of today’s best
effort servicescheduling and policing
mechanismsnext generation Internet: Intserv,
RSVP, Diffserv