application transport network data link physical application - PowerPoint PPT Presentation


PPT – application transport network data link physical application PowerPoint presentation | free to download - id: 3bafde-MDQxN


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

application transport network data link physical application


application transport network data link physical application transport network data link physical application transport network data link physical Chapter 4 The ... – PowerPoint PPT presentation

Number of Views:108
Avg rating:3.0/5.0
Slides: 134
Provided by: rangerUt2
Learn more at:


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

Title: application transport network data link physical application

Chapter 4 The Network Layer Routing
  • The network layer moves transport layer segments
    from host to host in the network, to deliver them
    to their destination. This layer involves each
    and every host and router in the network. We
    will study the key principles and algorithms of
    routing, with a focus on the Internet Protocol
    (IP) service model.

Network layer functions
  • transport packet from sending to receiving hosts
  • network layer protocols in every host, router
  • three important functions
  • path determination route taken by packets from
    source to destination - routing algorithms
  • switching move packets from routers input to
    appropriate router output
  • call setup some network architectures require
    router call setup along path before data flows
    (what types?)

Virtual circuits
  • the source-to-destination path behaves much like
    a telephone circuit
  • performance-wise
  • network actions along source-to-destination path
  • call setup, teardown for each call before data
    can flow
  • each packet carries VC identifier (not
    destination host ID)
  • every router/switch on source-destination path
    maintains a state for each passing connection
  • Recall transport-layer connection only involved
    two end systems
  • link and router resources (bandwidth, buffers)
    may be dedicated to the VC
  • to get circuit-like performance
  • but what about start-up delay?

Virtual circuits signaling protocols
  • used to setup, maintain and teardown the VC
  • used in ATM, frame-relay and X.25
  • not used in the Internet (why?)

6. Receive data
5. Data flow begins
4. Call connected
3. Accept call
1. Initiate call
2. incoming call
Datagram networks the Internet model
  • no call setup at network layer
  • routers do not maintain state for the end-to-end
  • no network-level concept of a connection
  • packets are typically routed using only
    destination host ID which is carried in the
  • packets between same source-destination pair may
    take different paths

1. Send data
2. Receive data
Summary Datagram or VC network why?
  • Internet
  • data exchange among computers
  • elastic service, no strict timing required
    (data delivery)
  • smart end systems (computers)
  • can adapt, perform control, error recovery
  • complexity at edge, simple in network core
  • many link types
  • different characteristics
  • uniform service difficult
  • ATM
  • evolved from telephony
  • human conversation
  • strict timing, reliability requirements
  • need for guaranteed service
  • dumb end systems
  • telephones, videophones
  • complexity inside the network

Consider IP over ATM (more later)
Goal determine a good path (sequence of
routers) thru the network from the source to the
  • Graph abstraction for routing algorithms
  • graph nodes are routers
  • graph edges are physical links
  • link cost delay, distance, of hops, rate
    structure or congestion level
  • Other costs??
  • good path
  • typically means minimum cost path
  • other definitions also possible

A Link-State Routing Algorithm
  • Dijkstras algorithm
  • net topology, link costs known to all nodes
  • accomplished via link state broadcast
  • all nodes have same info
  • computes least cost paths from one node
    (source) to all other nodes
  • yields a routing table for that node
  • iterative after k iterations, know least cost
    path to k destinations
  • Notation
  • c(i,j) link cost from node i to node j. Cost is
    initially infinite if not a direct neighbor
  • D(v) current computed value of cost of the path
    from the source to destination v
  • p(v) predecessor node, that is a neighbor of v,
    along the path from the source to v
  • N set of nodes whose least cost path is
    definitively known

Dijsktras Algorithm
1 Initialization 2 N A //
Source node is A 3 for all nodes v 4
if v adjacent to A 5 then D(v) c(A,v)
6 else D(v) infinity 7 8 Loop 9
find w not in N such that D(w) is a minimum 10
add w to N 11 update D(v) for all v
adjacent to w and not in N 12 D(v) min(
D(v), D(w) c(w,v) ) 13 / new cost to v is
either old cost to v or known 14 shortest
path cost to w plus cost from w to v / 15
until all nodes in N
Dijkstras algorithm example
D(B),p(B) 2,A 2,A 2,A - -
D(D),p(D) 1,A - - - -
Step 0 1 2 3 4 5
D(C),p(C) 5,A 4,D 3,E 3,E -
D(E),p(E) infinity 2,D - - -
D(F),p(F) infinity infinity 4,E 4,E 4,E
Distance Vector Routing Algorithm
  • iterative
  • continues until no nodes exchange info.
  • self-terminating no signal to stop
  • asynchronous
  • nodes need not exchange info/iterate in lock
  • distributed
  • each node communicates only with
    directly-attached neighbors
  • Distance Table data structure
  • each node has its own
  • row for each possible destination
  • column for each directly-attached neighbor to
  • example in node X, for destination Y via
    neighbor Z

distance from X to Y, via Z as next hop

c(X,Z) minw DZ(Y,w)

Distance Table example
loop back through E!
loop back through E!
Distance table gives routing table
Outgoing link to use, cost
A,1 D,5 D,4 D,2
Routing table
Distance table
Distance Vector Algorithm(Bellman-Ford)
At all nodes, X
1 Initialization 2 for all adjacent nodes v
3 D (,v) infinity / the
operator means "for all rows" / 4 D (v,v)
c(X,v) 5 for all destinations, y 6
send min D (y,w) to each neighbor / w over
all X's neighbors /
Distance Vector Algorithm (cont.)
8 loop 9 wait (until I see a link cost
change to neighbor V 10 or until I
receive update from neighbor V) 11 12 if
(c(X,V) changes by d) 13 / change cost to
all dest's via neighbor v by d / 14 /
note d could be positive or negative / 15
for all destinations y D (y,V) D (y,V) d
16 17 else if (update received from V wrt
destination Y) 18 / shortest path from V to
some Y has changed / 19 / V has sent a
new value for its min DV(Y,w) / 20 /
call this received new value is "newval" /
21 for the single destination y D (Y,V)
c(X,V) newval 22 23 if we have a new min
D (Y,w)for any destination Y 24 send new
value of min D (Y,w) to all neighbors 25 26
Distance Vector link cost changes
  • Link cost changes
  • node detects local link cost change
  • updates distance table (line 15)
  • if cost change in least cost path, notify
    neighbors (lines 23,24)

algorithm terminates
good news travels fast
Distance Vector link cost changes
  • Link cost changes
  • good news travels fast
  • bad news travels slowly - count to infinity

algorithm continues on!
Distance Vector poisoned reverse
  • If Z routes through Y to get to X
  • Z tells Y its (Zs) distance to X is infinite (so
    Y wont route to X via Z)
  • will this completely solve count to infinity

algorithm terminates
Comparison of LS and DV algorithms
  • Message complexity
  • LS with n nodes, E links, O(nE) msgs
  • DV exchange between neighbors only
  • convergence time varies
  • Speed of Convergence
  • LS O(n2) algorithm requires O(nE) msgs
  • may have oscillations
  • DV convergence time varies
  • may be routing loops
  • count-to-infinity problem
  • poisoned reverse is sometimes successful
  • Robustness what happens if router malfunctions?
  • LS
  • node can advertise incorrect link cost
  • each node computes only its own table
  • DV
  • DV node can advertise incorrect path cost
  • each nodes table used by others
  • errors propagate through the network

Hierarchical Routing
  • Our routing study thus far an idealization
  • all routers are identical
  • the network is flat
  • not true in practice
  • Why?
  • administrative autonomy
  • internet network of networks
  • each network admin may want to control routing in
    its own network
  • scale with 55 million destination hosts
  • cant store all destinations in routing tables!
  • routing table exchange would swamp links!

Hierarchical Routing
  • aggregate routers into regions, called
    autonomous systems (AS)
  • routers in same AS run same routing protocol
  • intra-AS routing protocol
  • routers in different AS can run different
    intra-AS routing protocol
  • special routers in AS
  • run intra-AS routing protocol with all other
    routers in AS
  • also responsible for routing to destinations
    outside AS
  • run inter-AS routing protocol with other gateway

Intra-AS and Inter-AS routing
  • Gateways
  • perform inter-AS routing amongst themselves
  • perform intra-AS routers with other routers in
    their AS

network layer
inter-AS, intra-AS routing in gateway A.c
data link layer
physical layer
Intra-AS and Inter-AS routing
Host h2
Intra-AS routing within AS B
Intra-AS routing within AS A
  • Well examine specific inter-AS and intra-AS
    Internet routing protocols shortly (section 4.5)

The Internet Network layer
  • Host, router network layer functions three major

Transport layer TCP, UDP
Network layer
Link layer
Physical layer
IP Addressing introduction
  • IP address 32-bit identifier for host or router
  • interface connection between host or router and
    the physical link
  • routers typically have multiple interfaces
  • hosts typically have only one
  • IP addresses are associated with the interface,
    not the host or the router
dotted-decimal notation 11011111 00000001 00000001 00000001
IP Addressing
  • IP address
  • network part (high order bits)
  • host part (low order bits)
  • Whats a network ? (from the IP address
  • device interfaces with the same network part of
    their IP address
  • hosts can physically reach each other without an
    intervening router
Example network consisting of 3 IP networks (for
IP addresses starting with 223, the first 24 bits
are the network address more later)
IP Addresses
  • Given the notion of a network, lets look
    closer at IP addresses

classful addressing -
class to
host (24 bits) to
host (16 bits) to
host (8 bits) to
32 bits
What is the address space size (number of hosts)
for each class?
IP addressing CIDR
  • classful addressing
  • inefficient use of address space, address space
  • e.g., class B network is allocated enough
    addresses for 65K hosts, even if only 2K hosts
    exist in that network
  • CIDR Classless InterDomain Routing
  • network portion of address of arbitrary length
  • address format a.b.c.d/x, where x is bits in
    the network portion of an address

IP addresses how to get one?
  • Hosts (host portion)
  • hard-coded by system admin in a file
  • DHCP Dynamic Host Configuration Protocol
    dynamically get address (RFC 2131)
  • host broadcasts DHCP discover msg
  • DHCP server responds with DHCP offer msg
  • host requests IP address DHCP request msg
  • DHCP server sends address DHCP ack msg

IP addresses how to get one?
  • Network (network portion)
  • get allocated portion of ISPs address space

ISP's block 11001000 00010111 00010000
00000000 Organization 0
11001000 00010111 00010000 00000000 Organization 1 11001000
00010111 00010010 00000000
Organization 2 11001000 00010111 00010100
00000000 ...
. . Organization
7 11001000 00010111 00011110 00000000
Getting a datagram from source to dest.
routing table in A
  • IP datagram
  • addresses remain unchanged, as the datagram
    travels from source to destination
  • address fields of interest here (provided by the
    source host A)

Note more on this later
Getting a datagram from source to dest.
  • Starting at A, given an IP datagram addressed to
  • look up network address of B
  • find B is on same network as A
  • link layer will send datagram directly to B
    inside link-layer frame
  • B and A are directly connected

Getting a datagram from source to dest.
misc fields
  • Starting at A, destination E
  • look up network address of E
  • E on different network
  • A, E not directly attached
  • routing table next hop router to E is
  • link layer sends datagram to router
    inside link-layer frame
  • datagram arrives at
  • continued..

Getting a datagram from source to dest.
misc fields
  • Arriving at, destined for
  • look up network address of E
  • E on same network as routers interface
  • router, E directly attached
  • link layer sends datagram to inside
    link-layer frame via interface
  • datagram arrives at!!!

IP datagram format
IP protocol version number
32 bits
total datagram length (bytes)
header length (bytes)
type of service
head. len.
datagram length
for fragmentation/ reassembly
fragment offset
type of data
16-bit identifier
max number of remaining hops (decremented at
each router)
upper layer
time to live
header checksum
32 bit source IP address
32 bit destination IP address
upper layer protocol to deliver payload to (e.g.
TCP, UDP, see RFC 1700)
e.g. timestamp, record route taken, specify list
of routers to visit (field is rarely used in
Options (if any)
data (variable length, typically a TCP or UDP
IP Fragmentation Reassembly
  • network links have MTU (Max. Transfer Unit) size
    - largest possible link-level frame.
  • different link types, different MTUs
  • large IP datagram divided (fragmented) within
  • one datagram becomes several datagrams
  • reassembled only at final destination
  • IP header bits used to identify and order related

fragmentation in one large datagram out 3
smaller datagrams
IP Fragmentation and Reassembly
One large datagram becomes several smaller
Internet AS Hierarchy
Inter-AS border (exterior gateway) routers
Intra-AS interior (gateway) routers
Intra-AS Routing
  • Also known as Interior Gateway Protocols (IGP)
  • Most common IGPs
  • RIP Routing Information Protocol (legacy)
  • OSPF Open Shortest Path First (common)
  • EIGRP Enhanced Interior Gateway Routing Protocol
    (proprietary Cisco Systems)

RIP ( Routing Information Protocol)
  • Distance vector algorithm
  • Included in BSD-UNIX Distribution in 1982
  • RFC 1058 (version 1), RFC 1723 (version 2)
  • Distance metric of hops (max 15 hops)
  • Can you guess why?
  • Distance vectors exchanged every 30 seconds via
    Response Message (also called advertisement)
  • Each advertisement routing info for maximum of
    25 destination nets within the AS

RIP Table processing
  • RIP routing tables managed by application-level
    process called route-d (UNIX daemon)
  • advertisements sent in UDP packets, periodically

RIP Table example (continued)
  • Router

Destination Gateway
Flags Ref Use Interface
-------------------- -------------------- -----
----- ------ --------- UH 0 26492 lo0
192.168.2. U
2 13 fa0 193.55.114. U 3 58503 le0
192.168.3. U
2 25 qaa0 U 3 0 le0
default UG
0 143454
  • Three attached class C networks (LANs)
  • Router only knows routes to attached LANs
  • Default router used to go up to next logical
  • Route multicast address
  • Loopback interface (for debugging)

OSPF advanced features (not in RIP)
  • Security all OSPF messages are authenticated (to
    prevent malicious intrusion) TCP connections
  • Multiple same-cost paths allowed (only one path
    in RIP)
  • For each link, multiple cost metrics for
    different Types Of Service (e.g., satellite link
    cost set low for best effort high for real
  • Integrated uni- and multicast support
  • Multicast OSPF (MOSPF) uses same topology data
    base as OSPF
  • Hierarchical OSPF in large domains.

Hierarchical OSPF
Hierarchical OSPF
  • Two-level hierarchy local area and backbone.
  • link-state advertisements only in local area
  • each node has detailed area topology only know
    direction (shortest path) to nets in other areas.
  • Area border routers summarize distances to
    nets in own area, advertise to other Area Border
  • Backbone routers run OSPF routing, limited to
  • Boundary routers connect to other ASs. (Note
    synonymous with the gateway routers we
    discussed in section 4.3)

Internet inter-AS routing BGP
  • BGP (Border Gateway Protocol) the de facto
  • Path Vector protocol
  • similar to Distance Vector protocol
  • each Border Gateway broadcasts to neighbors
    (peers) the entire path (I.e, sequence of ASs) to
  • E.g., Gateway X may send its path to destination
  • Path (X,Z) X,Y1,Y2,Y3,,Z

Internet inter-AS routing BGP
  • Suppose gateway X send its path to peer gateway
  • W may or may not select a path offered by X
  • cost, policy (dont route via competitors AS),
    loop prevention reasons.
  • If W selects a path advertised by X, then
  • Path (W,Z) W, Path (X,Z)
  • Note X can control incoming traffic by
    controlling its route advertisements to peers
  • e.g., dont want to route traffic to Z -gt dont
    advertise any routes to Z

Internet inter-AS routing BGP
  • BGP messages exchanged using TCP.
  • BGP messages
  • OPEN opens TCP connection to peer and
    authenticates sender
  • UPDATE advertises new path (or withdraws old)
  • KEEPALIVE keeps connection alive in absence of
    UPDATES also ACKs OPEN request
  • NOTIFICATION reports errors in previous message
    also used to close connection

Why different Intra- and Inter-AS routing ?
  • Policy
  • Inter-AS admin wants control over how its
    traffic is routed, who routes through its net.
  • Intra-AS single admin, so no policy decisions
  • Scale
  • hierarchical routing saves table size, reduces
    update traffic
  • Performance
  • Intra-AS can focus on performance
  • Inter-AS policy may dominate over performance

Router Architecture Overview
  • Two key router functions
  • run routing algorithms/protocol (RIP, OSPF, BGP)
  • switch datagrams from incoming to outgoing link

Input Port Functions
Physical layer bit-level reception
  • Decentralized switching
  • given datagram dest., lookup output port using
    routing table in input port memory
  • goal complete input port processing at line
  • queuing if datagrams arrive faster than
    forwarding rate into switch fabric (i.e., the
    packet is blocked)

Data link layer e.g., Ethernet see chapter 5
Problem how long does it take to perform a
Input Port Queuing
  • If routing fabric is slower than input ports
    combined -gt queuing may occur at input queues
  • Head-of-the-Line (HOL) blocking queued datagram
    at front of queue prevents others in queue from
    moving forward
  • queuing delay and loss due to input buffer

Three types of switching fabrics
(interconnection network)
Switching Via Memory
  • First generation routers
  • packet copied by systems (single) CPU
  • speed limited by memory bandwidth (2 system bus
    accesses per datagram)
  • Modern routers
  • input port processor performs lookup, copy into
    shared memory
  • Cisco Catalyst 8500

Switching Via Bus
  • datagram from input port memory
  • to output port memory via a shared bus
  • bus contention switching speed limited by bus
    bandwidth (only one packet at a time can use bus)
  • 1 Gbps bus - Cisco 1900 sufficient speed for
    access and enterprise routers (not regional or

Switching Via An Interconnection Network
(commonly Crossbar)
  • overcomes bus bandwidth
  • limitations
  • Banyan networks, other
  • interconnection nets initially
  • developed to connect processors
  • in multiprocessor design
  • advanced design fragments
  • datagram into fixed length cells, switches cells
  • through the fabric.
  • Cisco 12000 switches up to 60 Gbps through the
  • interconnection network

Output Ports
  • Buffering required when datagrams arrive from the
    fabric faster than the transmission rate
  • Scheduling discipline chooses among queued
    datagrams for transmission

Output port queuing
  • buffering when arrival rate via switching fabric
    exceeds output line speed
  • queuing (delay) and loss due to output port
    buffer overflow!

Question where is queuing most likely to occur?
  • Initial motivation 32-bit address space
    completely allocated (gone!) by 2008 (maybe
    sooner maybe later!).
  • Additional motivation
  • header format changes were needed to improve
    speed of processing and forwarding
  • header changes were required to facilitate QoS
  • a new anycast address was needed route to
    best of several replicated servers
  • IPv6 datagram format
  • fixed-length 40 byte header (32 for addresses)
  • no fragmentation allowed

IPv6 Header
Priority identify priority among datagrams in
flow Flow Label identify datagrams in same
flow. (concept of flow
not well defined). Next header identify upper
layer protocol for data
8 bytes
32 bytes
Other Changes from IPv4
  • Fragmentation not allowed/supported
  • 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 (IGMP)

Transition From IPv4 To IPv6
  • Not all routers can be upgraded simultaneous
  • no flag days (e.g. NCP to TCP attempt in c.
  • How will the network operate with mixed IPv4 and
    IPv6 routers?
  • Two proposed approaches (RFC 1933)
  • Dual Stack some routers with dual stack (v6, v4)
    can translate between formats
  • Tunneling IPv6 carried as payload in IPv4
    datagram among IPv4 routers

Dual Stack Approach
IPv6 inside IPv4 where needed
Multicast routing
  • IGMP message types
  • membership queries general or specific
  • membership report host wants to join
  • leave group host leaves a specific group
  • message format
  • Carried in IP datagram
  • IP protocol of 2
  • Internet multicast routing algorithms
  • DVMRP distance vector
  • MOSPF open shortest path first
  • CBT core-based trees
  • PIM protocol independent
  • Inter-autonomous routing
  • DVMRP de facto standard for multicast

Chapter 5 Link Layer Local AreaNetworks
  • The link layer is responsible for the
  • transport of network layer datagrams from node to
    node via established physical links. In this
    chapter well study the principal services of
    this layer, and look at specific protocols
    employed in the LANs, hubs, bridges and switches
    in the Internet. Well also investigate
    Ethernet, ATM, X.25 and Frame Relay.

Link Layer setting the context
  • two physically connected devices
  • host-router, router-router, host-host
  • unit of data frame

data link protocol
phys. link
adapter card
Link Layer Implementation
  • implemented in adapter
  • e.g., PCMCIA card, Ethernet card
  • typically includes RAM, DSP chips, host bus
    interface, and physical link interface

network link physical
data link protocol
phys. link
adapter card
Error Detection
  • EDC Error Detection and Correction bits
  • D Data protected by error checking, may
    include header fields
  • Error detection not 100 reliable!
  • protocol may miss some errors, but rarely
  • larger EDC field yields better detection and

Parity Checking
Two Dimensional Bit Parity Detect and correct
single bit errors
Single Bit Parity Detect single bit errors
Whats the problem with this method?
What else can we do with this method?
Checksumming Cyclic Redundancy Check
  • view data bits, D, as a binary number
  • choose r1 bit pattern (generator), G
  • goal choose r CRC bits, R, such that
  • ltD,Rgt exactly divisible by G (modulo 2)
  • receiver knows G, divides ltD,Rgt by G.
  • non-zero remainder gt error detected!
  • can detect all burst errors less than r1 bits
  • ATM 5-byte header uses 8-bit CRC
  • IEEE GCRC-32 , 32-bit CRC for Ethernet, etc.
  • widely used in practice (ATM, HDLC)

CRC Example
Must be r1 bits long. High and low-order bits
must be 1s.
Yields 101110011
  • Want
  • D.2r XOR R nG
  • equivalently
  • D.2r nG XOR R
  • equivalently
  • if we divide D.2r by G, want reminder R

D.2r G
R remainder
Multiple Access Links and Protocols
  • Three types of links
  • point-to-point (single wire, e.g. PPP, SLIP,
  • broadcast (shared wire or medium e.g, Ethernet,
    Wavelan, etc.)
  • switched (e.g., switched Ethernet, ATM, etc.)

Multiple Access protocols
  • single shared communication channel
  • two or more simultaneous transmissions by nodes
  • generally, only one node can send successfully at
    a time
  • multiple access protocol
  • distributed algorithm that determines how
    stations share channel, i.e., determine when a
    station can transmit
  • communication about channel sharing must use
    channel itself!
  • what to look for in multiple access protocols
  • synchronous or asynchronous
  • information needed about other stations
  • robustness (e.g., tolerance of channel errors)
  • performance and efficiency

Multiple Access protocols
  • Desirable characteristics of a MAP channel of
    rate R bps
  • only one node sending throughput is R bps
  • M nodes sending average throughput is R/M bps
  • decentralized control no master nodes that
    control sending/receiving
  • the protocol is simple and inexpensive to
  • MAC protocols Media Access Control
  • often called the MAC sub-layer (of the data link

MAC Protocols a taxonomy
  • Three broad classes
  • Channel Partitioning
  • divide channel into smaller pieces (time slots,
  • allocate piece to node for exclusive use
  • Random Access
  • allow transmitted frames to collide
  • recover from collisions
  • Taking turns
  • tightly coordinate shared access to avoid

Goal efficient, fair, simple, decentralized
Channel Partitioning MAC protocols TDMA
  • TDMA time division multiple access
  • access to channel in "rounds"
  • each station gets fixed length slot (length pkt
    transmission time) in each round
  • unused slots go idle
  • example 6-station LAN hosts 1,3,4 have
    packets, time slots 2,5,6 idle

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 goes
  • example 6-station LAN - hosts 1,3,4 have
    packets, frequency bands 2,5,6 idle

frequency bands
Channel Partitioning (CDMA)
  • CDMA (Code Division Multiple Access)
  • unique code assigned to each user i.e., code
    set partitioning
  • used mostly in wireless broadcast channels
    (cellular, satellite,etc)
  • all users share same frequency/medium, but each
    user has own chipping sequence (i.e., code) to
    encode data
  • encoded signal (original data) X (chipping
  • decoding inner-product of encoded signal and
    chipping sequence
  • allows multiple users to coexist and transmit
    simultaneously with minimal interference (if
    codes are pairwise orthogonal)

CDMA two-sender interference
CDMA 4-sender example
Chipping Sequences for 4 nodes A 00011011 A
(-1 1 1 1 1 1 1 1) B 00101110 B (-1 1
1 1 1 1 1 1) C 01011100 C (-1 1 1 1
1 1 1 1) D 01000010 D (-1 1 1 1 1 1
1 1)
Note for all S and T, S?T 0
Example recovery of node Cs signal S1 ? C
(1 1 1 1 1 1 1 1 )/8 1 S2 ? C (2 0
0 0 2 2 0 2)/8 1 S3 ? C (0 0 2 2 0
2 0 -2)/8 0 S4 ? C (1 1 3 3 1 1 1
-1)/8 1 S5 ? C (4 0 2 0 2 0 2 2)/8
1 S6 ? C (2 2 0 2 0 2 4 0)/8 -1
Slotted Aloha efficiency
  • Q what is max fraction of slots successful?
  • A Suppose N stations have packets to send
  • each transmits in slot with probability p
  • probability of successful transmission S is
  • by single node S p (1-p) (N-1)
  • S Prob (only one
  • by any arbitrary node of the N nodes
  • N p (1-p) (N-1)
  • choosing optimum p as N -gt
    infinity ...
  • 1/e .37 as N -gt infinity

CSMA Carrier Sense Multiple Access
  • CSMA listen before transmit
  • If channel sensed as idle transmit entire packet
  • If channel sensed as busy defer transmission
  • Persistent CSMA retry immediately with
    probability p when channel becomes idle (may
    cause instability)
  • Non-persistent CSMA retry after random interval
  • human analogy be polite and wait your turn,
    dont interrupt others!

CSMA collisions
spatial layout of nodes along Ethernet
collisions can occur propagation delay means
two nodes may not hear each others transmission
collision entire packet transmission time wasted
note role of distance and propagation delay in
determining collision prob.
CSMA/CD (Collision Detection)
  • CSMA/CD carrier sensing, deferral as in CSMA
  • collisions detected within short time
  • colliding transmissions aborted, reducing wasted
    channel bandwidth
  • persistent or non-persistent retransmission
  • 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 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
  • Token passing
  • control token passed from one node to next
  • token message
  • concerns
  • token overhead
  • latency
  • single point of failure (token)
  • Polling
  • master node invites slave nodes to transmit in
  • Request to Send, Clear to Send msgs
  • concerns
  • polling overhead
  • latency
  • single point of failure (master)

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

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

How many possible LAN/Physical addresses?
LAN Address (more)
  • MAC address allocation administered by IEEE
  • manufacturer buys a portion of the MAC address
    space (to assure uniqueness) see current
  • Analogy
  • (a) MAC address like Social Security
  • (b) IP address like postal address
  • MAC flat address gt portability
  • can move LAN card from one LAN to another
  • IP hierarchical address NOT portable
  • depends on network to which one attaches

Recall earlier routing discussion
  • Starting at A, given an IP datagram addressed to
  • look up network address of B, find B on same
    network as A
  • link layer sends a datagram to B inside
    link-layer frame

frame source, destination address
datagram source, destination address
As IP address
Bs IP address
Bs MAC address
As MAC address
IP payload
ARP Address Resolution Protocol
  • Each IP node (Hosts Routers) on a LAN has an
    ARP module and 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 lt 20 minutes)

Question how can we determine the MAC address of
B given Bs IP address?
ARP protocol (RFC 826)
  • A knows B's IP address, wants to learn physical
    address of B
  • A broadcasts ARP query packet, containing B's IP
  • all machines on LAN receive ARP query
  • B receives the ARP packet, replies to A with its
    (B's) physical layer (MAC) address
  • A caches (saves) IP-to-physical address pairs
    until information becomes old (times out TTL)
  • soft state information that times out (goes
    away) unless refreshed

Side effects performance implications?
Ethernet Frame Structure
  • Sending adapter encapsulates IP datagram (or
    other network layer protocol packet) in Ethernet
  • Preamble
  • 7 bytes with pattern 10101010, followed by one
    byte with pattern 10101011 (frame delimiter)
  • used to synchronize receiver, sender clock rates

(802.3 Data Length)
Note IEEE 802.3 specifies that frame length,
excluding preamble, must be between 64 and 1518
bytes. Data is padded, if necessary, to ensure
minimum length achieved
Ethernet Frame Structure (more)
  • Addresses 6 bytes, frame is received by all
    adapters on a LAN and dropped if address does not
  • Type (Length) 2 bytes, indicates the higher
    layer protocol, mostly IP but others may be
    supported such as Novell IPX and AppleTalk). If
    802.3 compliant, this field is length of data
    segment (min. 46 bytes)
  • CRC 4 bytes, checked at receiver, if error
    detected, the frame is simply dropped

Ethernet uses CSMA/CD
  • A sense channel, if idle (96 clock ticks/bit
  • then
  • transmit and monitor the channel
  • If detect another transmission
  • then
  • abort and send jam signal
  • update collisions
  • delay as required by exponential backoff
  • goto A
  • else done with the frame set collisions to
  • else wait until ongoing transmission is over and
    goto A

Ethernets CSMA/CD Efficiency
  • Recall that the probability of successful
    transmission in a slot is P Np(1-p)(N-1)
  • which yields a mean probability of success
    (efficiency) of P 1/e, for an optimal p1/N
    as N -gt infinity.
  • Note that each 802.3 slot has a duration of the
    one-bit RTT (max) for the LAN (51.2 ?sec)
  • The average contention interval length (i.e., how
    long you must wait) is the duration of the
    interval divided by the probability, or 2tprop
    / 1/e 2etprop
  • Taking ttrans to be the time it takes to
    transmit an average frame, channel efficiency can
    then be expressed as

ttrans ttrans 2e tprop
1 1 5.4 tprop /ttrans
Ethernets CSMA/CD Efficiency
1.0 0.9 0.8 0,7 0.6 0.5 0.4 0.3 0.2 0.1
1024 byte frames
512 byte frames
256 byte frames
Channel Efficiency
128 byte frames
64 byte frames
0 1 2 4 8
16 32 64 128 256
Number of Stations Trying to Send
Ethernet Technologies 10Base2
  • 10 10Mbps 2 under 200 meters (actually 185)
    max. cable length per segment
  • thin coaxial cable in a bus topology
  • repeaters used to connect up to multiple segments
  • repeater repeats bits it hears on one interface
    to its other interfaces physical layer device

10BaseT and 100BaseT
  • 10/100 Mbps rate latter called fast ethernet
  • T stands for Twisted Pair
  • Nodes are connected to hubs by twisted pair, thus
    star topology
  • CSMA/CD monitoring can be implemented at hub

10BaseT and 100BaseT (more)
  • Max. distance from node to Hub is 100 meters
  • max. between any two nodes is 200 meters
  • Hub can disconnect jabbering adapter
  • Hub can gather monitoring information, statistics
    for display to LAN administrators
  • Fiber links can be used to expand geographical
    reach (per IEEE 802)

Q How do you calculate the time it takes to send
a datagram from one node to another via a hub?
Token Passing IEEE802.5 standard
  • 4 Mbps
  • max token holding time 10 ms, limiting frame

  • SD, ED mark start, end of packet (each 8 bits)
  • AC access control byte (8bits)
  • token bit value 0 means token can be seized,
    value 1 means data follows FC
  • priority bits priority of packet
  • reservation bits station can write these bits to
    prevent stations with lower priority packet from
    seizing token after token becomes free

Interconnecting LANs
  • Q Why not just one big LAN?
  • Limited amount of supportable traffic on single
    LAN, all stations must share bandwidth
  • limited length 802.3 specifies maximum cable
  • large collision domain (can collide with many
  • limited number of stations 802.5 have token
    passing delays at each station

Devices for Interconnecting LANs
  • Hubs (repeaters)
  • physical-layer bit-level repeaters
  • extend physical reach of a LAN
  • 10/100BaseT interconnection (repeaters for
  • Bridges
  • link-layer, frame switches
  • extend physical reach and scale of a LAN
  • allow logical segregation of a LAN
  • Switches
  • Link-layer, high performance bridge

Hub limitations
  • single collision domain results in no increase in
    max throughput
  • multi-tier throughput same as single segment
  • individual LAN restrictions pose limits on number
    of nodes in same collision domain and on total
    allowed geographical coverage
  • cannot connect different Ethernet types (e.g.,
    10BaseT and 100baseT

Hub Bit In, Bit Out
  • Link Layer devices operate on Ethernet frames,
    examining frame header and selectively forwarding
    frame based on its destination
  • Bridge isolates collision domains since it
    buffers frames
  • When frame is to be forwarded on segment, bridge
    uses CSMA/CD to access segment and transmit

Bridges frame filtering, forwarding
  • bridges filter packets
  • same-LAN -segment frames not forwarded onto other
    LAN segments
  • forwarding
  • how to know which LAN segment on which to forward
  • looks like a routing problem (more shortly!)

Bridge Filtering
  • bridges learn which hosts can be reached through
    which interfaces maintain filtering tables
  • when frame received, bridge learns location of
    sender incoming LAN segment
  • records sender location in filtering table
  • filtering table entry
  • (Node LAN Address, Bridge Interface, Time Stamp)
  • stale entries in Filtering Table dropped (TTL can
    be 60 minutes)

Bridge Filtering
  • filtering procedure
  • if destination is on LAN on which frame was
  • then drop the frame
  • else lookup filtering table
  • if entry found for destination
  • then forward the frame on interface indicated
  • else flood / forward on all but the
  • on which the frame

Bridge Learning example
  • Suppose C sends frame to D and D replies back
    with frame to C

C 1 ltltlt added
  • C sends frame, bridge has no info about D, so
    floods to other attached LANs (on ports 2 and 3)
  • bridge notes that C is on port 1
  • frame ignored on upper LAN (port 3)
  • frame received by D (port 2)

Bridge Learning example
C 1 D 2 ltltlt added
  • D generates reply to C, sends
  • bridge sees frame from D
  • bridge notes that D is on interface 2
  • bridge knows C on interface 1, so selectively
    forwards frame out via interface 1

Bridges vs. Routers (or layer-3 switches)
  • both are store-and-forward devices
  • routers network layer devices (examine network
    layer headers)
  • bridges are link layer devices
  • routers maintain routing tables, implement
    routing algorithms
  • bridges maintain filtering tables, implement
    filtering, learning and spanning tree algorithms

Ethernet Switches
  • cut-through switching frame forwarded from input
    to output port without awaiting for assembly of
    entire frame
  • not a store-and-forward operation
  • slight reduction in latency over
  • combinations of shared/dedicated, 10/100/1000
    Mbps interfaces

IEEE 802.11 Wireless LAN
  • wireless LANs untethered (often mobile)
  • IEEE 802.11 standard
  • MAC protocol
  • unlicensed frequency spectrum 900Mhz, 2.4Ghz
  • Basic Service Set (BSS) (a.k.a. cell) contains
  • wireless hosts
  • access point (AP) base station
  • BSSs combined to form distribution system (DS)

Ad Hoc Networks
  • Ad hoc network IEEE 802.11 stations can
    dynamically form network without AP
  • Applications
  • laptop meeting in conference room, car!
  • interconnection of personal devices
  • battlefield
  • IETF MANET (Mobile Ad hoc Networks) working

IEEE 802.11 MAC Protocol CSMA/CA
  • 802.11 CSMA sender
  • - if sense channel idle for DIFS sec.
  • then transmit entire frame (no collision
  • -if sense channel busy then exponential backoff
    (like Ethernet)
  • 802.11 CSMA receiver
  • if received OK
  • return ACK after SIFS

IEEE 802.11 MAC Protocol
  • 802.11 CSMA Protocol others
  • NAV Network Allocation Vector
  • 802.11 frame has transmission time field
  • others (hearing data) defer access for NAV time

Hidden Terminal effect
  • hidden terminals A, C cannot hear each other
  • obstacles, signal attenuation
  • collisions at B
  • goal avoid collisions at B
  • CSMA/CA CSMA with Collision Avoidance

Collision Avoidance RTS-CTS exchange
  • CSMA/CA explicit channel reservation
  • sender send short RTS request to send
  • receiver reply with short CTS clear to send
  • CTS reserves channel for sender, notifying
    (possibly hidden) stations
  • avoid hidden station collisions

Collision Avoidance RTS-CTS exchange
  • RTS and CTS short
  • collisions less likely, of shorter duration
  • end result similar to collision detection
  • IEEE 802.11 allows
  • CSMA
  • CSMA/CA reservations
  • polling from AP

Point to Point Data Link Control
  • one sender, one receiver, one link easier than
    broadcast link
  • bit-oriented transmission stream
  • no Media Access Control
  • no need for explicit MAC addressing
  • e.g., dialup link, ISDN line
  • popular point-to-point DLC protocols
  • PPP (point-to-point protocol)
  • HDLC High-level data link control
  • Data link used to be considered a high layer in
    the protocol stack!

PPP Design Requirements RFC 1557
  • packet framing encapsulation of network-layer
    datagram 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 others network address

PPP non-requirements (explicit in the
  • no error correction/recovery
  • no flow control
  • no ordering out of order delivery OK
  • no need to support multipoint links (e.g.,

Error recovery, flow control, data
re-ordering/sequencing all relegated to higher
PPP Data Frame
  • Flag delimiter (framing)
  • Address does nothing (only one option in PPP)
  • Control does nothing in the future possible
    multiple control fields
  • Protocol upper layer protocol to which frame
    delivered (e.g., C021x PPP-LCP, 8021x IPCP,
    0021x IP, 0029x AppleTalk, etc.)

PPP Data Frame
  • info upper layer data being carried
  • check cyclic redundancy check (CRC) for error

Maximum payload length is negotiated by link
control protocol at link establishment, or
default is 1500 bytes.
Byte Stuffing
  • data transparency requirement data/info field
    must be allowed to contain special bit
    patterns, such as flag lt01111110gt
  • Q is received lt01111110gt data or flag?
  • Sender adds (stuffs) a special control escape
    byte lt 01111101gt byte before each lt 01111110gt
    data byte
  • Q what about lt01111101gt in the data?
  • Receiver
  • when lt01111101gt received discard it, then
    continue data reception
  • single 01111110 flag byte

ATM architecture
  • adaptation layer only at edge of ATM network
  • data segmentation/reassembly
  • roughly analogous to Internet transport layer
  • ATM layer network layer
  • cell switching, routing
  • physical layer

ATM Layer
  • Service transport cells across ATM network
  • analogous to IP network layer
  • very different services than IP network layer

Guarantees ?
Network Architecture Internet ATM ATM ATM ATM
Service Model best effort CBR VBR ABR UBR
Congestion feedback no (inferred via
loss) no congestion no congestion yes no
Bandwidth none constant rate guaranteed rate gua
ranteed minimum none
Loss no yes yes no no
Order no yes yes yes yes
Timing no yes yes no no
ATM Layer ATM cell
  • Core of ATM standard
  • 5-byte ATM cell header
  • 48-byte payload
  • Why? small payload -gt short cell-creation delay
    for digitized voice
  • halfway between 32 and 64 (compromise!)

Cell header
Cell format
ATM cell header
  • VCI virtual channel ID
  • will change from link to link thru net
  • PT Payload type (e.g. RM cell, idle cell, data
  • CLP Cell Loss Priority bit
  • CLP 1 implies low priority cell, can be
    discarded if congestion
  • HEC Header Error Checksum (8-bit)
  • cyclic redundancy check

  • Issues
  • Conversion of IP datagrams into ATM AAL5 PDUs
  • Conversion from IP addresses to ATM addresses
  • just like IP addresses to 802.3 MAC addresses!

ATM backbone network
Ethernet LANs
Datagram Journey in IP-over-ATM Network
  • at Source Host/Gateway
  • IP layer finds mapping between IP and ATM
    destination address (using ARP)
  • passes datagram to AAL5
  • AAL5 encapsulates data, segments to cells, passes
    to ATM layer
  • ATM network moves cell along Virtual Circuit
    (permanent?) to destination
  • at Destination Host/Gateway
  • AAL5 reassembles cells into original datagram
  • if CRC OK, datagram is passed to IP