Fundamentals Circuit-Switching Packet-Switching Virtual-Circuit-Switching Excursion Bibliography Data Communications and Networking COSC 264 Introduction to Communication Networks Dr. Andreas Willig 1 Dr. Muhammad Asad Arfeen 2 1 Dept. of Computer Science and Software Engineering University of Canterbury, Christchurch 2 Dept. of Computer and Information Systems Engineering NED University of Engineering & Technology, Karachi UoC, 2014
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
• So far we have mostly studied communication between two
stations, using a single channel
• How can we communicate in a larger population of users /
stations / terminals? Say: all persons in a country?
• Fundamental aim of networks:
• Provide good “reachability” and “service quality” to users. . .• . . . but do so at reasonable costs for the users . . .• . . . and giving revenue to network providers
• Networks are getting more useful to users as the number
• A primary task in any network is to identify suitable routes
• Subject to constraints on capacities, allowable delay, . . .• Respectful to existing traffic flows• Remember setting up the route from D to B• This is called routing
• A second task is to avoid traffic overload situations inspecific network areas, or at least to react properly to them
• This is called congestion control• The switching element close to B and C will likely not
accept much more traffic• Do you know of a real-life example of congestion control?
• A good way to support voice / CBR traffic is to set up adedicated connection or circuit between end points for theduration of the connection
• Think of this as a “private cable”
• The lifetime of a connection encompasses three phases:
• Connection setup: identify route, set aside resources
(buffers, processing capacity, bandwidth) in switching
elements and links, so that resources are guaranteed• Connection usage: use the established connection to
transmit CBR data – the pre-reserved resources guarantee
that this connection is not influenced by other connections• Connection teardown: free the reserved resources• How do you trigger these steps in the POTS?
• Switching elements in CS networks are called switches
• Reserved rate is not well utilized during traffic pauses• Reserved rate might be too small during traffic peaks• No re-use of underutilized connections by other
connections
ConclusionA more flexible networking mechanism is needed for data
• Since flow data rates and routes often cannot be predicted
in advance, routers buffer some packets to prevent packet
dropping in temporary overload situations
• Routers only have a finite amount of memory, and when
overload situation sustains, packet dropping is inevitable,
this is called congestion
• Important question: which packets to drop?
• Congestion control schemes either try to avoidcongestion or to deal with it in a graceful manner, e.g. by:
• Subject packet flows to admission control• Sending signals to traffic sources to reduce data rates• Make good decisions about which packets to drop (e.g.
based on priorities) – applications must help here!!• Modify the pricing during congestion
• For each new packet router must make a routing decision
• Generally, routing decision can be based on many factors:
• Source address, destination address• Packet priorities, type of data carried (video, web, . . . )• Link states of various candidate outputs• Queue lengths at various candidate outputs• Reachability of destination at various candidate outputs
• But: this is too complex for high-performance routers
• Can give guaranteed bandwidths• No statistical multiplexing, no re-use of resources• Data forwarding is low-complexity operation for switches• Routing is done only once
• Packet-switching:
• Cannot (easily) give any guarantees• Allows statistical multiplexing• Data forwarding is higher-complexity operation for routers• Routing is done for every packet
• Can we marry these approaches and have their benefits
• Virtual circuit switching is a combination of packet- and
circuit-switching
• Major characteristics:
• It is connection-oriented, i.e. a connection needs to be
established before data transfer can commence• Information in a connection is transmitted in packets• A connection can accommodate VBR traffic• Statistical multiplexing capabilities are offered!• All packets in a connection follow the same path, packet
processing in switches is simpler than for routers• Often there are no (strict) bandwidth guarantees for a
Rudolf Ahlswede, Ning Cai, Shuo-Yen Robert Li, and Raymond W. Yeung.Network information flow.IEEE Transactions on Information Theory, 46(4):1204–1216, July 2000.
John C. Bellamy.Digital Telephony.John Wiley and Sons, Chichester, UK, third edition, 2000.
Jon C. R. Bennett, Craig Partridge, and Nicholas Shectman.Packet Reordering is Not Pathological Network Behaviour.IEEE/ACM Transactions on Networking, 7(6):789–798, December 1999.
Martin DePrycker.Asynchronous Transfer Mode - The solution for Broadband-ISDN.Prentice Hall, New York , London, second edition, 1994.
Olivier Hersent, David Gurle, and Jean-Pierre Petit.IP Telephony – Packet-based multimedia communications systems.Addison-Wesley, Harlow / England, London, 2000.
Anurag Kumar, D. Manjunath, and Joy Kuri.Communication Networking – An Analytical Approach.Morgan Kaufmann Publishers, San Francisco, 2004.
Raif O. Onvural.Asynchronous Transfer Mode Networks - Performance Issues.Artech House, Boston, London, second edition, 1995.
Mike Sexton and Andy Reid.Broadband Networking – ATM, SDH and SONET.
William Stallings.Data and Computer Communications.Prentice Hall, Englewood Cliffs, New Jersey, fourth edition, 2006.
George Varghese.Network Algorithmics: An Interdisciplinary Approach to Designing FastNetworked Devices.Morgan Kaufmann Publishers, San Francisco, 2004.
Raymond W. Yeung.Information Theory and Network Coding.Springer, New York, 2008.
Raymond W. Yeung, Shuo-Yen Robert Li, Ning Cai, and Zhen Zhang.Network Coding Theory.now Publishers Inc., Boston / Delft, 2006.
Protocol Layering Elements of Service and Protocol Design Bibliography
Data Communications and Networking
COSC 264Network Architectures and Protocol Basics
Dr. Andreas Willig1
Dr. Muhammad Asad Arfeen2
1Dept. of Computer Science and Software EngineeringUniversity of Canterbury, Christchurch
2Dept. of Computer and Information Systems EngineeringNED University of Engineering & Technology, Karachi
UoC, 2014
Protocol Layering Elements of Service and Protocol Design Bibliography
Outline
Protocol Layering
The Concept of Layering
The OSI Reference Model
The TCP/IP Reference Model
Elements of Service and Protocol Design
Service Primitives
A few Standard Protocol Mechanisms
Protocol Layering Elements of Service and Protocol Design Bibliography
About this Module
• We look at architectures for packet-switched networks
• Goals:
• Understand protocol layering and two reference models• Understand the concepts of services, protocols and the
relationship between both
• This module is based on [8, Chap. 2], [4]
• Further references: [3], [2], [9], [1], [5]
Protocol Layering Elements of Service and Protocol Design Bibliography
Outline
Protocol Layering
Elements of Service and Protocol Design
Protocol Layering Elements of Service and Protocol Design Bibliography
Networking Software
• The Internet and POTS are among the most complex
technical systems, they require vast amounts of software
• Structuring principles help to organize networkingsoftware to achieve:
• Modularity and software re-use• Independence of network technologies (Transparency)• Separation of concerns• Correctness
Layering
A key structuring principle for networking software is layering:
the functionality is decomposed into a chain of layers so that
layer N offers services (through an interface) to layer N + 1
and itself is only allowed to use services offered by layer N − 1.
Protocol Layering Elements of Service and Protocol Design Bibliography
Outline
Protocol Layering
The Concept of Layering
The OSI Reference Model
The TCP/IP Reference Model
Elements of Service and Protocol Design
Protocol Layering Elements of Service and Protocol Design Bibliography
Layering Concepts
Protocol Layering Elements of Service and Protocol Design Bibliography
Layering Concepts (2)
• A layer N offers an N-service interface
• The next higher layer N + 1 is only allowed to use the N-interface, but not any ofthe lower interfaces (e.g. the N − 1 interface) – this applies to all layers!
• The N-interface offers services at service access points (SAP)
• The N-interface can offer several SAPs, this allows to multiplex between differentlayer N + 1 protocols or different layer N + 1 “connections” or “sessions”
• Example: POTS offers voice and fax services, uses telephone sockets as SAPs
Protocol Layering Elements of Service and Protocol Design Bibliography
Layering Concepts (3)
• The layer N-service is implemented through an N-protocol
• The N-protocol makes direct use of N − 1 services
• The N-protocol makes no assumption whatsoever on what is on layer N + 1
• It exchanges protocol data units (PDUs) with a peer N-protocol entity – itconstructs these PDUs itself and hands them over to its local N − 1-layer todeliver them to peer N-protocol entity (which in turn receives it from its localN − 1 layer)
Protocol Layering Elements of Service and Protocol Design Bibliography
General Layout of a PDU
• The N-PDU is constructed by the N-protocol entity
• It carries the data handed over by layer N + 1 for transmission, also referred toas user data or N-SDU (service data unit)
• The sending N-protocol entity adds an N-protocol header which carries controlinformation (e.g. sequence numbers, addresses, flags) important for theN-protocol but not the receiving N + 1 layer
• It might furthermore add an N-protocol trailer (usually a checksum)
• The receiving N-protocol entity removes the N header and trailer and hands overthe N + 1 data to its local layer N + 1 entity
Protocol Layering Elements of Service and Protocol Design Bibliography
Layered PDU Processing
• An N-PDU is treated as payload / user data by the N − 1 layer
• Each layer adds own header and trailer before handing down to lower layer
• Receiving layer removes its header / trailer before handing payload to upper layer
• How would you support efficient PDU processing in operating systems?
Protocol Layering Elements of Service and Protocol Design Bibliography
About Interfaces
• Interfaces specify a service that a certain layer offers
• Example:
• The socket interface offers reliable, in-sequence and
byte-oriented data transfer through an interface somewhat
resembling a file system interface• The TCP/IP protocol stack implements this service• Applications just use the socket interface and are not
concerned with the operation of the TCP protocol
Important Point
Standardized interfaces allow higher layers to ignore the
operation and properties of lower layers
• Several (not only networking) standard documents tend to
specify interfaces, and not procedures / algorithms
Protocol Layering Elements of Service and Protocol Design Bibliography
Cross-Layer Approaches
• How many layers should a protocol stack have?
• Having many layers . . .
• . . . can lead to clean and modular software• . . . incurs more overhead (processing, headers)
• Existing protocol stack architectures have no more than
five to seven layers, some have less
• Recently, cross-layer designs have become popular:
• Non-neighbored layers are allowed to exchange information
and use their services• Done for performance reasons• But: can lead to unwanted interactions between layers [5]
Protocol Layering Elements of Service and Protocol Design Bibliography
Outline
Protocol Layering
The Concept of Layering
The OSI Reference Model
The TCP/IP Reference Model
Elements of Service and Protocol Design
Protocol Layering Elements of Service and Protocol Design Bibliography
The OSI Seven Layer Model
• OSI = Open Systems Interconnection
• Set of standards and protocols createdby ISO
• See [9]
• The model was not commerciallysuccessful, but helped greatly to clarifynetworking architectures anddiscussion
Protocol Layering Elements of Service and Protocol Design Bibliography
The OSI Seven Layer Model – A Second View
• Lowest three layers exchange PDUs between physically connected hosts
• Upper four layers exchange protocol messages between end hosts (perhapsover several intermediate nodes, called routers)
• This already hints at a network architecture where end nodes are interconnectedthrough routers!
Protocol Layering Elements of Service and Protocol Design Bibliography
OSI RM – Physical Layer
• Concerned with transmission of digital data (e.g. bits,
bytes) over a physical medium
• Often involves specification of:
• Cable types (wired) or frequencies / bandwidth (wireless)• Connectors• Electrical specifications• Modulation / demodulation and signal specification• Carrier- or bit synchronization methods
Protocol Layering Elements of Service and Protocol Design Bibliography
OSI RM – Link Layer
• Task: (reliable) transfer of messages over physical link
• Link layer messages are often called frames
• Often involves specification of:• Framing:
• delineation of frame start and end• choice of frame size
• Error control (e.g. coding or retransmission-based)
• Coding is also often regarded as a PHY functionality
• Medium access control
• distributes right to send on shared channel to several
participants• often considered as a separate “sub-layer” of link layer
• Flow control
• Avoid overwhelming a slow receiver with too much data
Protocol Layering Elements of Service and Protocol Design Bibliography
OSI RM – Network Layer
• Concerned with:
• Providing a link technology-independent abstraction of
entire network to higher layers• Addressing and routing• End-to-end delivery of messages
• Network- and higher-layer messages are called packets
• Often involves specification of:
• Addressing formats• Exchange of routing information and route computation• Depending on technology: establishment, maintenance and
teardown of connections
Protocol Layering Elements of Service and Protocol Design Bibliography
OSI RM – Transport Layer
• Concerned with:
• (reliable, in-sequence, transparent) end-to-end data transfer• programming abstractions (interface) to higher layers
• Often involves specification of:
• Error-control procedures (Question: why again?)• Flow control procedures• Congestion control procedures
• Protect network against overloading• Can also be considered a network-layer issue
Protocol Layering Elements of Service and Protocol Design Bibliography
OSI RM – Session and Representation Layer
• Session layer:
• Concerned with establishing communication sessions
between applications• A session can involve several transport layer connections in
parallel or sequentially• A session might control the way in which two partners
interact, for example enforce that partners speak
alternatingly
• Representation layer:
• Translates between different representations of data types
used on different end hosts• Example: host A uses low-endian ints, host B big-endian
Protocol Layering Elements of Service and Protocol Design Bibliography
OSI RM – Application Layer
• Contains application support functions or functionalities
used in many applications
• Examples:
• File transfer services• Directory services• Transaction processing support (e.g. two-phase commit)
Protocol Layering Elements of Service and Protocol Design Bibliography
Outline
Protocol Layering
The Concept of Layering
The OSI Reference Model
The TCP/IP Reference Model
Elements of Service and Protocol Design
Protocol Layering Elements of Service and Protocol Design Bibliography
The TCP/IP Reference Model
• This model is used in the Internet
• The Internet follows the so-calledend-to-end principle: Layers 3 andbelow are kept simple, mostcomplexity resides in transport layer
Protocol Layering Elements of Service and Protocol Design Bibliography
The TCP/IP Reference Model – A Second View
• This reference model also uses a network architecture where end nodes (calledhosts) are interconnected through routers!
Protocol Layering Elements of Service and Protocol Design Bibliography
The Application Layer
• Consists of applications using services of transport layer
• Accesses transport layer through socket interface
• There are well-known application-layer protocols, e.g.:
• SMTP (email)• HTTP (web)• FTP (file transfer)• RTP (real-time video and audio)
Protocol Layering Elements of Service and Protocol Design Bibliography
The Transport Layer
• Provides end-to-end communications to applications
but other protocols can be used as well (e.g. SCTP)
• SAPs are called ports, used for application multiplexing
• Several applications / processes can use transport service• One application is bound to one port• Ports are identified by numbers• The PDUs generated by TCP / UDP are called segments• TCP / UDP segments include the port number• TCP / UDP receiver delivers incoming segment to the
application denoted by the port number
Protocol Layering Elements of Service and Protocol Design Bibliography
The Transport Layer (2)
• TCP has mechanisms for:
• Error control (retransmission-based) and in-order delivery• Flow control• Congestion control
• UDP has none of these features
• TCP and UDP hand over segments to the Internet layer
Protocol Layering Elements of Service and Protocol Design Bibliography
The Internet Layer
• This is a key part of the TCP/IP reference model
• Uses IP (Internet Protocol), its PDUs are called datagrams
• All higher-layer segments are encapsulated in datagrams
• The IP protocol:
• specifies an addressing scheme• provides end-to-end delivery of datagrams (forwarding)• does not specify how routing is done, left to dedicated
protocols• has no mechanisms for error, flow and congestion control• can send IP datagram over any network interface
Protocol Layering Elements of Service and Protocol Design Bibliography
The Internet Layer (2)
• “Everything over IP, IP over everything”
Protocol Layering Elements of Service and Protocol Design Bibliography
The Physical and Network Interface Layer
• The physical layer is similar to the PHY of the OSI RM
• The Network Interface Layer:
• Accepts IP datagrams and delivers them over physical link• Receives IP datagrams and delivers them to local IP layer• Includes medium access control, framing, address
resolution• Might also include link-layer error- and flow control
Protocol Layering Elements of Service and Protocol Design Bibliography
End-to-End Principle
• The Internet layer protocol (IP) is very simple
• Transport protocols run only in the hosts
• This is the end-to-end principle [7]:
• Keep routers simple• Realize reliability, sequencing etc. only in end hosts
Protocol Layering Elements of Service and Protocol Design Bibliography
Outline
Protocol Layering
Elements of Service and Protocol Design
Protocol Layering Elements of Service and Protocol Design Bibliography
The Five Elements of a Protocol
• Compare [4]
• A protocol specification should explain:
• the service provided• the assumptions about the environment in which it operates• the vocabulary of messages (PDUs) used by the protocol• the encoding (binary representation) of the messages• the procedure rules guarding the consistency of exchanges
of messages and service primitives
• The rules are the hardest to get right
Important Point
A protocol implements a service. Higher layers only use the
service and are not exposed to the internals of the protocol!
Protocol Layering Elements of Service and Protocol Design Bibliography
Why is Protocol Engineering so complex?
• Network protocols run as a distributed system of entities
(computers, routers) exchanging messages
• Networking protocols need mechanisms to deal with:
• Loss of messages• Failure of network links• Crash of entities• Large differences in processing speeds among entities• Incompatible data representations• Equipment from different vendors• Random delays in message transmission• Errors induced into messages (e.g. by the channel)• . . .
• Many of these are non-issues in software running on single
computer!
Protocol Layering Elements of Service and Protocol Design Bibliography
Protocol Engineering
• Major steps in protocol engineering
• Design of service and protocol• Initial performance evaluation• Formal specification of service and protocol design
• Often as finite state automata, e.g. in SDL language
• Validation: is the (formal) design doing the right things?
• Does it fulfill the service?• Presence of deadlocks? Liveness?• Can undesirable situations occur?
• Protocol implementation• Verification and testing: does the implementation
correspond to the formal specification?• Performance tuning, e.g. optimization of parameters
• See [6], [4]
Protocol Layering Elements of Service and Protocol Design Bibliography
Outline
Protocol Layering
Elements of Service and Protocol Design
Service Primitives
A few Standard Protocol Mechanisms
Protocol Layering Elements of Service and Protocol Design Bibliography
Service Providers and Service Users
• An N-protocol implements an N-service
• Stated differently: the N-protocol is the N-service provider!
• An N+1-protocol (or the application) is the N-service user
• Service provider and user:
• talk to each other through service primitives• have to obey rules in the usage of services
• Example: before a telephone can use any “send voice data”
service, it must have used “connection setup” service before
• Stated differently: service provider and user also run a
protocol for exchanging service primitives!
• Standard service primitives for a service S:
• S.request
• S.indication
• S.response
• S.confirmation
Protocol Layering Elements of Service and Protocol Design Bibliography
Confirmed Service
• Service user at A issues anS.request service primitive,possibly carrying user data
• The service provider for S (aprotocol) generates one or morePDUs and sends them to host B
• Service user at B is informedabout A’s service requestthrough an S.indication primitive
• Service user at B preparesresponse (possibly with data),gives it to local service providerthrough S.response
• B’s response is made known toA’s service user throughS.confirm primitive
• Key point: response comes fromB’s service user!
• Do you know an example?
Protocol Layering Elements of Service and Protocol Design Bibliography
Unconfirmed Service
• Service user at A issues anS.request primitive
• Service provider for S generatesone or more PDUs and sendsthem to host B
• Service user at B is informedthrough an S.indication primitive
• Service user at A has no cluewhether service request hasreached B
• Do you know an example?
Protocol Layering Elements of Service and Protocol Design Bibliography
Confirmed Delivery Service
• Roughly similar to confirmedservice
• Key difference: it is B’s serviceprovider generating a response,not B’s service user!
• Thus, A’s service user has noinformation about the behaviourof B’s service user
• Do you know an example?
Protocol Layering Elements of Service and Protocol Design Bibliography
Confirmed Transmission Service
• Roughly similar to theunconfirmed service
• Key difference: service user at Agets confirmation that any PDUsrelated to its service requesthave indeed been sent
• Do you know an example?
Protocol Layering Elements of Service and Protocol Design Bibliography
Outline
Protocol Layering
Elements of Service and Protocol Design
Service Primitives
A few Standard Protocol Mechanisms
Protocol Layering Elements of Service and Protocol Design Bibliography
Multiplexing
• Multiplexing allows to transmitdata from several N SAPs over asingle N − 1 SAP
• When several N SAPs are usedin parallel, the N protocol entityneeds to make schedulingdecisions to decide which NSAP to serve next
• Sending N entity needs toinclude an SAP identifier into theN PDU to allow receiver entity todeliver an incoming N-PDU tothe right SAP
• Example: TCP supports severalSAPs through port numbers,port numbers are part of TCPheader
Protocol Layering Elements of Service and Protocol Design Bibliography
Splitting
• An N-entity can transmit datareceived from higher layers viaN-SAP over several N − 1 SAPs
• Allows transmission of data overseveral channels to increasethroughput and / or reliabilitythrough parallel transmission
• N-entity needs to makescheduling decisions on whichN − 1 SAP to use for a givenPDU
Protocol Layering Elements of Service and Protocol Design Bibliography
Fragmentation and Reassembly
• PDUs often have a limited size –on the lower layers this is usuallyfor physical reasons
• To make PDU sizes transparentto higher layers, an N-layer canaccept large N-SDUs andpartition the data into severalN-PDUs (fragments), eachhaving own header, and transmitthem separately
• Fragments must be numbered toallow receiver correctre-assembly
• Question: How should thereceiver deal with losses ofPDUs?
• Disadvantage: higher overhead
Protocol Layering Elements of Service and Protocol Design Bibliography
Blocking and Deblocking
• Sometimes higher layersproduce very small N-SDUs
• Instead of putting each N-SDUinto separate N-PDU, transmitterwaits until several N-SDUs arepresent (blocking) and putsthem into one N-PDU to saveoverhead
• Receiver entity decomposesreceived N-PDU (deblocking)and delivers several N-SDUs tohigher layers, this requiresmarkers in the N-PDUseparating the N-SDUs
• Question: when should senderstop collecting N-SDUs andsend an N-PDU?
Protocol Layering Elements of Service and Protocol Design Bibliography
Sequence Numbers
• An N-entity can maintain a sequence number
• For each newly constructed PDU the sequence number is
written into the N-PDU header, afterwards the sequence
number is incremented
• Sequence numbers allow the receiver to:
• Detect duplicate PDUs (and drop them)• Detect lost PDUs (and possibly request their retransmission
from sender)• Put N-PDUs back in the right order when network has
reordered them
• Implementation issues:
• Sequence number space is finite, wrapovers need to be
handled• Choice of initial sequence number
Protocol Layering Elements of Service and Protocol Design Bibliography
Mung Chiang, Steven H. Low, A. Robert Calderbank, and John C. Doyle.Layering as Optimization Decomposition: A Mathematical Theory of NetworkArchitectures.Proceedings of the IEEE, 95(1):255–312, January 2007.
Douglas E. Comer.Internetworking with TCP/IP – Principles, Protocols and Architecture, volume 1.Prentice Hall, Upper Saddle River, New Jersey, fifth edition, 2006.
John Day.Patterns in Network Architecture – A Return to Fundamentals.Prentice Hall, Upper Saddle River, New Jersey, 2008.
Gerard J. Holzmann.Design and Validation of Computer Protocols.Prentice Hall, Englewood Cliffs, 1992.
Vikas Kawadia and P. R. Kumar.A Cautionary Perspective on Cross-Layer Design.IEEE Wireless Communications, 12(1):3–11, February 2005.
Miroslav Popovic.Communication Protocol Engineering.CRC Press, Boca Raton, Florida, 2006.
Jerome H. Saltzer, David P. Reed, and David D. Clark.End-to-end arguments in system design.ACM Transactions on Computer Systems, 2(4):277–288, November 1984.
Protocol Layering Elements of Service and Protocol Design Bibliography
William Stallings.Data and Computer Communications.Prentice Hall, Englewood Cliffs, New Jersey, fourth edition, 2006.
Hubert Zimmermann.OSI Reference Model–The ISO Model of Architecture for Open SystemsInterconnection.IEEE Transactions on Communications, 28(4):425–432, April 1980.
LANs MAC Bridges, Switches Bibliography
Data Communications and Networking
COSC 264Local Area Networks
Introduction
Dr. Andreas Willig1
Dr. Muhammad Asad Arfeen2
1Dept. of Computer Science and Software EngineeringUniversity of Canterbury, Christchurch
2Dept. of Computer and Information Systems EngineeringNED University of Engineering & Technology, Karachi
UoC, 2014
LANs MAC Bridges, Switches Bibliography
Outline
LANs
Introduction
LAN Protocol Architecture
Topologies
MAC
Fundamentals
Orthogonal Schemes: FDMA, TMDA, SDMA, CDMA
Random Access Protocols
Other Schemes
Bridges, Switches
Repeaters and Hubs
Bridges and Switches
LANs MAC Bridges, Switches Bibliography
Outline
LANs
MAC
Bridges, Switches
LANs MAC Bridges, Switches Bibliography
Preliminaries
• The following slides are based mainly on [44], [38]
• The older, but still very good book [7] covers some related
• They have limited geographical extension, usually ≤ 1 km
• Offer a shared transmission medium to multiple stations
• Often controlled by only one owner / administrative entity
• Offer low cost for station attachment
• Support higher rates than usually experienced over
wide-area networks
• Some application areas:
• Connect desktop computers to share files, emails, . . .• Allow several computers to share printers, file servers, . . .• Interactive video or telephony between local users
LANs MAC Bridges, Switches Bibliography
LANs vs. WANs
• WAN = Wide Area Network:
• have national, continental or global geographical extension• typically controlled by several administrative entities• Often use high-capacity fibers for long-haul links
• WAN Examples:
• Internet• POTS
• In the Internet, LANs are an elementary unit
• Internet = Network of Networks!• LANs are attached to Routers, Routers are interconnected
via other LANs or via point-to-point connections
LANs MAC Bridges, Switches Bibliography
Outline
LANs
Introduction
LAN Protocol Architecture
Topologies
MAC
Bridges, Switches
LANs MAC Bridges, Switches Bibliography
LAN Protocol Architecture
• LAN standards typically specify the following layers:
IEEE 802.11n supports up to 600 Mb/s• Infrared, IrDA supported 1 Gb/s over very short distances
LANs MAC Bridges, Switches Bibliography
The MAC
• MAC will be covered shortly ...
LANs MAC Bridges, Switches Bibliography
Logical Link Control – LLC
• LLC: link layer protocol specification for IEEE 802.x
standards
• LLC focuses on frame transmission to direct, single-hop
neighbours
• Major responsibilities:
• Error control• Flow control• Framing• Service provisioning to higher layers
LANs MAC Bridges, Switches Bibliography
LLC – Error Control
• Frames can be corrupted due to:
• Thermal noise in the receiver• Too low signal strength at the receiver• Collisions on the channel• Interference from external transmitters• Faulty processing• . . .
• Many applications don’t tolerate erroneously received data
• The MAC layer is often regarded as a separate sub-layer
between PHY and link-layer
• This view is supported by the fact that the MAC has a
distinguished task not covered by any other layer
• MAC protocols are heavily influenced by the properties of
the underlying transmission medium
LANs MAC Bridges, Switches Bibliography
MAC Definition
• We are given:
• A number of users / stations wishing to communicate• A shared communications channel / resource that can only
be used by one station at a time• No other means for information exchange between stations
DefinitionMAC protocols are rules by which distributed stations
coordinate access to a common channel to share it efficiently
and in a manner satisfying given performance requirements
Example: 100 blind persons in a room – how to distribute the
right to talk?
LANs MAC Bridges, Switches Bibliography
Important Assumptions
• The shared channel is a broadcast medium, i.e.transmission of one station is heard by all other stations
• Not necessarily true for wireless transmission media
• In case of parallel transmissions all contendingtransmissions are garbled, i.e. cannot be reliably decoded
• Not necessarily true for wireless transmission media• Often not true for CDMA systems, also not in OFDMA
LANs MAC Bridges, Switches Bibliography
MAC Design Desiderata
• Small medium access delay: time between arrival of packetto empty station and start of successful transmission
• Depends on overheads: collisions, waiting times, . . .• For lightly loaded medium a small access delay is desirable• Hard real-time applications require bounded access delay
• In real-time applications: support for packet priorities, i.e.distinction between important and less important packets
• Local priorities: station makes local decisions, but A’s
important packets can be blocked by B’s unimportant ones• Global priorities: all stations reach consensus (how?) about
which station has most important packet
• Fairness and fair re-use of unused resources
• Efficiency: low overhead, high throughput
• Stability: increasing load should not decrease throughput
Note: you usually do not get all of these at the same time . . .
LANs MAC Bridges, Switches Bibliography
MAC vs Duplexing
• Channel duplexing schemes occur naturally when
full-duplex operation is required, e.g. in voice conversations
• These schemes allow a station to separate its transmitted
signals from its received signals
• Difference between duplexing and the MAC problem:
• MAC coordinates transmissions of multiple users• Duplexing coordinates parallel transmission and reception
for a single user
• But: MAC mechanisms can be used to implement
duplexing
LANs MAC Bridges, Switches Bibliography
Outline
LANs
MAC
Fundamentals
Orthogonal Schemes: FDMA, TMDA, SDMA, CDMA
Random Access Protocols
Other Schemes
Bridges, Switches
LANs MAC Bridges, Switches Bibliography
Orthogonal Schemes
• In orthogonal schemes the behavior of one station does
not influence the behavior / throughput / transmission
success / . . . of other stations
• The four main (mostly) orthogonal schemes are:
• FDMA = Frequency Division Multiple Access• TDMA = Time Division Multiple Access• SDMA = Space Division Multiple Access• CDMA = Code Division Multiple Access
• We will not discuss SDMA and CDMA
LANs MAC Bridges, Switches Bibliography
Frequency Division Multiple Access (FDMA)
LANs MAC Bridges, Switches Bibliography
FDMA (2)
• The given channel bandwidth is subdivided into N
sub-channels
• Between the sub-channels and at the fringe of the channelthere are guard bands:
• Reduction of adjacent-channel interference
• A sub-channel is exclusively assigned to a station i on a
long-term basis for transmission of data, no other station
is allowed to transmit on this channel
• To receive data, a station must:
• Either possess one separate receiver for each channel, or• have a single tunable receiver that must be switched to a
specific channel before data can be received on it
• Problems: coordination/rendez-vous, tuning times
LANs MAC Bridges, Switches Bibliography
FDMA (3)
• If totally available bandwidth is Bbs,station iisassigned≈ 1N of
B on a long-term basis (neglecting guard bands)
• Medium access delay for a new packet arriving to an
empty station i is always zero, since i can start
transmission immediately without risk of collision
• If a packet has size BN bits, its transmission takes exactly
one second, i.e.:
Transmission Delay = 1
where transmission delay is the time until transmission of a
frame completes (measured after arrival to empty station)
LANs MAC Bridges, Switches Bibliography
FDMA – Advantages
• N stations can transmit in parallel
• There is no need for time synchronization between the N
transmitters
LANs MAC Bridges, Switches Bibliography
FDMA – Disadvantages
• Need for N receivers or tunable receivers increases
system complexity
• Frequency synchronization required
• There is no re-use, i.e. channels unused by one station
cannot be used by others
ConclusionFDMA is good for CBR but bad for VBR traffic
LANs MAC Bridges, Switches Bibliography
Time Division Multiple Access (TDMA)
LANs MAC Bridges, Switches Bibliography
TDMA (2)
• Each station uses the whole frequency band (except someguard bands at the fringe of the spectrum), but only atcertain times:
• Time is subdivided into superframes of duration TSF
• Each superframe is subdivided into N time-slots• There are short guard times between time slots• One or more time slots are exclusively and long-term
assigned to a station i for transmission
• Stations must be time-synchronized to avoid overlapping
transmissions, guard times are required to compensate
(small) synchronization errors
LANs MAC Bridges, Switches Bibliography
Access and Transmission Delay in TDMA
• Neglecting guard times, each station gets the full channel
bandwidth Bbsforafractionof 1N of time
• Assume that:
• station i owns one time slot• TSF = 1 second• a time-slot suffices to transmit B
Nbits
• a packet of BN
bits arrives at random time to empty station i
• Medium access delay = waiting time until station i ’s next
slot starts
Access Delay =TSF
2= 0.5s
LANs MAC Bridges, Switches Bibliography
Access and Transmission Delay in TDMA (2)
• The time to transmit the packet is 1N seconds
• Assuming no channel errors we have:
Transmission Delay = Access Delay +1
Ns
= 0.5s +1
Ns ≤ 1s
for N > 2 this is a true inequality
ConclusionIn this example in TDMA we start later and finish sooner than
with FDMA!!
LANs MAC Bridges, Switches Bibliography
TDMA – Advantages and Disadvantages
• Advantages:
• It is easier to achieve asymmetric bandwidth assignments
in TDMA than in FDMA: using multiple time-slots is much
simpler than transmitting on multiple frequencies in parallel• TDMA tends to have better transmission delays than FDMA• No tunable receivers required
• Disadvantages:
• Tight time-synchronization between stations required• High expected access delay even in otherwise idle systems• Not possible to re-use unused time slots
ConclusionTDMA is good for CBR but bad for VBR traffic
LANs MAC Bridges, Switches Bibliography
Orthogonal Schemes – Discussion
• These schemes separate users perfectly from each other
• Typically they assign resources (frequency, time) to users
on longer timescales, which may be permanent or for the
duration of a call
• In so-called demand-assignment schemes resources are
also exclusively assigned to stations, but on much shorter
timescales (e.g. duration of a data burst in data traffic) [24]
ConclusionIn orthogonal schemes resource (de)allocation is considered a
rare event, in demand-assignment (DA) schemes not. DA
schemes must be much more efficient in signaling resource
(de)allocation.
LANs MAC Bridges, Switches Bibliography
Outline
LANs
MAC
Fundamentals
Orthogonal Schemes: FDMA, TMDA, SDMA, CDMA
Random Access Protocols
Other Schemes
Bridges, Switches
LANs MAC Bridges, Switches Bibliography
Random Access Protocols
• Random Access protocols:
• do not attempt to reserve channel resources for longer time• do not require a central station or (much) shared state• do not access the medium at predictable times• often have low complexity (e.g. only little signaling, if any)• typically involve some random element
• Random access protocols are used standalone and alsoas building blocks for more complex protocols, e.g.:
• ALOHA / slotted ALOHA is used for signaling bandwidth
requests in demand-assignment protocols• In GSM a mobile uses slotted ALOHA to request call setup
Important Point
Random access protocols accept risk of collisions to save
coordination overhead and have overall improved efficiency!
LANs MAC Bridges, Switches Bibliography
ALOHA / Slotted ALOHA
• ALOHA [1] is one of the earliest MAC protocols, developed
≈ 1970 at the University of Hawaii
• Assumptions:
• N uncoordinated transmitters• One receiver (e.g. a base station)• If two packets overlap at receiver, a collision occurs
LANs MAC Bridges, Switches Bibliography
The Pure ALOHA Protocol
• When a new packet arrives at an empty station:
• a checksum is computed and appended to the frame• the frame is then transmitted immediately, there is no
coordination with other stations• an acknowledgement timer is started
• The receiver sends an immediate ack upon successful
reception of a packet – upon collisions or transmission
errors it remains quiet
• If the transmitter receives an ack, the frame is removed
and the ack timer is canceled
LANs MAC Bridges, Switches Bibliography
The Pure ALOHA Protocol (2)
• When ack timer expires, transmitter enters backoff mode:
• The transmitter chooses a random backoff time• It waits for this time without further action• At backoff timer expiry the frame is re-transmitted• The ack timer is set again, backoff mode is left• Question: why is the backoff time chosen randomly?
• When the number of failed trials exceeds a threshold, the
frame is dropped
• The precise choice of random distribution for backoff timesis critical for delay, throughput and stability! [13], [27]
• Often the random distribution depends on the number of
subsequent collisions seen by the frame• An example backoff strategy will be discussed later!
• When a new packet arrives to backlogged station, it is
stored in queue and served after all previous packets
LANs MAC Bridges, Switches Bibliography
Advantages of Pure ALOHA
• Quite simple to implement
• If network load is small:
• new frames are sent immediately =⇒ access delay is zero• they can use the full channel bandwidth• and the probability of collision at the receiver is low
ConclusionFor low network loads most packets can have the minimum
possible transmission delay
LANs MAC Bridges, Switches Bibliography
Disadvantages of Pure ALOHA
• Consider stations A and B sending frames of same length:
• When B starts its frame during the (two frame times long)
vulnerability period of A’s frame, the frames collide
• When more stations are active / load is increased, the
collision probability increases
• ALOHA cannot distinguish between collisions and channel
errors destroying a frame
LANs MAC Bridges, Switches Bibliography
Throughput
• Suppose all packets have the same length, packet transmission time is τ
• Define througput as the (average) number of successfully received packetsduring time τ in the absence of channel errors
• Which of these (idealized) curves is the throughput of ALOHA? And which onethe throughput of FDMA? How about the other curves?
LANs MAC Bridges, Switches Bibliography
Slotted ALOHA
• Slotted ALOHA is similar to ALOHA, but:
• Time is subdivided into time slots• A time slot is sufficient to accommodate frame
transmission, two round-trip times and ack transmission• All stations are time-synchronized• Any frame transmission has to start at slot boundary
ConclusionThe vulnerability period is reduced to one time-slot, slotted ALOHA
has better throughput
LANs MAC Bridges, Switches Bibliography
The CSMA-Family of Protocols
• CSMA = Carrier Sense Multiple Access [25], [49]
• Common assumption: all stations can determine the stateof the medium (almost) instantaneously:
• Busy: at least one station is currently transmitting• Idle: no station is transmitting
This operation is called carrier-sensing (CS) or
clear-channel assessment (CCA)
• Common approach: Listen-before-talk• Before station transmits a frame, it performs CS operation• If channel is busy, station defers transmission according to
one of several possible strategies• The maximum number of deferrals (or backoffs) a station
might experience for a frame is often bounded
• CSMA protocols do not eliminate collisions completely, but
reduce their rate or their impact
LANs MAC Bridges, Switches Bibliography
The CSMA-Family of Protocols (2)
• CSMA approach is especially useful when mediumpropagation time is small compared to packet length, sinceother stations notice transmission quickly after it started
• Typically satisfied in LANs, propagation delay is small• By this, collisions can only occur when two stations start
transmitting at almost the same time (time difference
smaller than propagation delay)
• When propagation time is large compared to packet length,the sender might have already stopped transmission whenreceiver senses busy carrier for first time
• Example: multi-access satellite configurations• Here LBT is almost useless, ALOHA is reasonable
LANs MAC Bridges, Switches Bibliography
Nonpersistent CSMA
• If a station senses a busy medium, it:
• draws a backoff time from a given random distribution• defers from channel activities during backoff time, and• then senses the medium again and starts over
• If the station detects an idle medium, it starts transmitting
immediately
• In case of a collision again a backoff time is chosen andprocess starts over
• Question: how to diagnose collisions?
• Performance problem: with high probability a medium is
idle for some time after transmission has finished, this
lowers utilization
LANs MAC Bridges, Switches Bibliography
p-persistent CSMA
• Be p ∈ (0, 1) a parameter known to all stations
• If a station senses a busy medium, it defers until the end of
the ongoing transmission, when medium becomes idle
• A station divides time on idle medium in small time slots• At the beginning of a time slot a station performs a random
experiment: with probability p it starts transmission, with
probability 1 − p it defers for one further slot• When station defers, it checks medium during remaining
slot time: when another station started transmission, station
waits for end of this transmission and starts over• Time slot just large enough to accommodate these activities
• In case of collision, process starts over
• Question: How would you choose p?
• Performance problem: again, medium will be idle for some
time after transmission has finished
LANs MAC Bridges, Switches Bibliography
1-persistent CSMA / CSMA-CD
• CSMA-CD was chosen for classical Ethernet
• If a station senses a busy medium, it defers until end of
ongoing transmission
• When medium becomes idle, station sends unconditionally
• This avoids idle times after previous transmission• But if two or more stations start, we surely have collision
and we need collision resolution procedure
• While transmitting, sender tests channel for collisions
• In case of a collision:
• Transmission is aborted• A jamming signal is sent to inform all stations about collision• A collision resolution procedure is started, e.g.:
• backoff schemes (used in Ethernet and WLANs)• tree algorithms [8]
LANs MAC Bridges, Switches Bibliography
Outline
LANs
MAC
Fundamentals
Orthogonal Schemes: FDMA, TMDA, SDMA, CDMA
Random Access Protocols
Other Schemes
Bridges, Switches
LANs MAC Bridges, Switches Bibliography
Polling Protocols
• Abstract view on polling systems:
• One central station / base station / hub• N clients / stations, each having a packet queue• The hub has two basic tasks:
• Query state of packet queues (e.g. # backlogged packets)• Grant bandwidth to stations based on results
• Querying a station should be less costly than data
transmission (e.g. in terms of bandwidth)
• Polling protocols are used to support time-bounded
services or minimum guaranteed bandwidth services e.g.
• Two logical channels are used for querying stations and
data transfer, but both can be mapped to one physical
channel
• A station must be known to the hub in order to be polled
=⇒ a registration protocol (e.g. ALOHA) is needed!
• Polling protocols can differ in:
• Polling sequence: in which sequence are stations polled• Service types: may a station send one or multiple packets
after it has been granted bandwidth?• Querying mechanisms: how is a station / a group of
stations queried?
LANs MAC Bridges, Switches Bibliography
Polling Protocols – Polling Sequences
• Round robin: all stations are polled one after another in a
circular fashion
=⇒ fair to all stations
• Table-driven polling: hub has an arbitrary list specifyingpolling sequence; if the end of the list is reached, the hubstarts over
• Allows uneven bandwidth distributions• Inflexible when traffic demands change• Often used in hard real-time systems
LANs MAC Bridges, Switches Bibliography
Polling Protocols – Service Types
• k -limited / time-limited service: a station is allowed to
transmit at most k packets or for at most t seconds
• Exhaustive service: a station may transmit packets as long
as its queue is nonempty
• Gated service: a station may send as many packets as arein the queue in the moment the grant / bandwidthassignment is received
• packets arriving during a stations service have to wait for
the next round
LANs MAC Bridges, Switches Bibliography
Polling Protocols – Querying Mechanisms
• Separate polling:
• the hub sends short poll packet to one station i• if station has nonempty queue, it starts transmitting• if station has empty queue, it remains quiet or returns extra
NULL packet to hub
• Separate polling has significant but constant overhead,
causes comparably long medium access delays for low
loads
LANs MAC Bridges, Switches Bibliography
Polling Protocols – Querying Mechanisms (2)
• Group testing is discussed in [51], [5], [8]
• Instead of sending a poll request to one station at a time, it
is sent to a group of stations
• Any station from group may answer with request packet:
• If no station answers, hub tests the next group• if one station answers, hub grants bandwidth to this station• if more than one station answers, a collision resolution
procedure is invoked; examples:
• query each station in the group separately• split group in two and group-test each sub-group separately
• Group testing shortens medium access delays in case of
light network load if groups are large
LANs MAC Bridges, Switches Bibliography
Polling Protocols – Querying Mechanisms (3)
• Piggybacking: if a station sends a data packet, it indicates
its request for further bandwidth in the packets header
=⇒ no need for extra signalling packets!
• Piggybacking is often used as an additional mechanism to
one of the other mechanisms
• Piggybacking alone is not sufficient, since a station cannot
request bandwidth for new packets arriving to empty queue
LANs MAC Bridges, Switches Bibliography
Polling Protocols – Querying Mechanisms (4)
• The query mechanisms described so far have twoimportant properties:
• Querying is initiated by the base station (except
piggybacking)• They are deterministic: for each station there is an upper
bound on the time before it can send its request
LANs MAC Bridges, Switches Bibliography
Polling Protocols – Querying Mechanisms (5)
• Reservation protocols [40]: another frequent case is thatquerying is initiated by a station:
• station sends reservation request packet to hub• hub either accepts or rejects the request – indicated by
appropriate response packets• one example setup is that all stations have to share a
common signalling channel, e.g. using the ALOHA protocol,
while the data channel can be used exclusively
• Reservation protocols work well if signalling is a rare event
• Examples: MASCARA [36] and DQRUMA [24]
LANs MAC Bridges, Switches Bibliography
Token-Passing Protocols
• Assumption: stations are attached to a broadcast medium
• The right to initiate data transmissions is passed between
stations using special token frames, no central station
• After receiving a token a station may send data for limitedtime, afterwards passes token to its successor
• In absence of errors this guarantees a bounded medium
access time, required in real-time applications
• The stations form a logical token passing ring whichconstitutes predecessor / successor relationships
• All stations must have consistent view on logical ring
• Organization of the logical ring requires ring maintenance
mechanisms (involving special control frames)
LANs MAC Bridges, Switches Bibliography
Token-Passing Protocols – Problems
• Maintaining a logical ring can be hairy, if:
• not all stations can hear each other (partially meshed
topology)• mobility is involved (variable topology)
• Loss of token / control frames can create severe problems
[23], [55]
• Token-passing protocols tend to be very complex
LANs MAC Bridges, Switches Bibliography
Outline
LANs
MAC
Bridges, Switches
LANs MAC Bridges, Switches Bibliography
Coupling LANs
• It is often required to couple existing LANs, e.g. upon
• A repeater amplifies a signal on the analog level
• Any noise present in the signal is amplified as well• Repeaters add their own noise• Repeaters are not at all visible to any protocol or
modulation scheme• They can create slight delay (order of µs and less)
LANs MAC Bridges, Switches Bibliography
Regenerating Repeaters
• A regenerating repeater demodulates an incoming signalsymbol-per-symbol and modulates it again
• No interpretation whatsoever of protocol fields is done• Especially, no error checking / error correction is done,
regeneration can introduce errors
LANs MAC Bridges, Switches Bibliography
Hubs
• A hub is a centralized repeater, itbroadcasts signals incoming on oneport to all other ports
• No interpretation of the incomingframe is done, none of its fields isevaluated
• All stations are attached with onetransmit and one receive line
• A hub creates a logical bus on aphysical star
• Hubs can be cascaded
• It may be regenerative or not
• Question: Advantage over bus?
LANs MAC Bridges, Switches Bibliography
Outline
LANs
MAC
Bridges, Switches
Repeaters and Hubs
Bridges and Switches
LANs MAC Bridges, Switches Bibliography
Bridges
• Bridges interconnect LANs on the MAC layer
Important Point
Bridges understand and interpret fields related to the MAC
protocol (e.g. address fields), repeaters / hubs do not!
• Nowadays they mostly connect LANs of the same type (i.e.
Ethernet – Ethernet), but bridges connecting LANs of
different types (e.g. Ethernet – Token Ring) also exist(ed)
• We focus on bridges interconnecting broadcast Ethernets
• Important: Ethernet frames carry an Ethernet source
address and an Ethernet destination address in their frame
header
• A bridge can connect several LANs
• Bridges can be cascaded
LANs MAC Bridges, Switches Bibliography
Basic Operation
• When bridge receives frame fromLAN A, it checks the frame forcorrectness, buffers it and checks theMAC destination address (dst)
• dst on LAN A: bridge does nothing
• dst on LAN B or dst unknown:bridge transmits frame on LAN B,following the rules of the MACprotocol!
• Same in direction B → A
• Bridge does not modify any frame,nor does it encapsulate them
• Stations need not be aware of thepresence of bridges (transparency)
LANs MAC Bridges, Switches Bibliography
Basic Operation (2)
• How does bridge know which stationis in which LAN?
• From reading a frames sourceaddress field (src) the bridge canlearn on which bridge interface asource can be reached
• When a bridge receives a frame withdst not having been observed sofar, it unconditionally re-transmits theframe on all interfaces exceptincoming one
• The latter approach is dangerouswhen several bridges are used andloops are present (see below)
LANs MAC Bridges, Switches Bibliography
Some Reasons to Use Bridges
• Reliability: by keeping LANs separated and only
interconnected by a bridge, failures in one LAN do not
affect others
• Performance: by carefully evaluating addresses, bridgescan confine traffic local to one LAN to that very LAN,enabling parallel local transmissions in different LANs
• Repeaters / hubs cannot do this “traffic separation”!
• Security: similarly, traffic local to one LAN cannot be
eavesdropped in the other LAN
LANs MAC Bridges, Switches Bibliography
Excursion: Encapsulating Bridges
• Bridges can be interconnectedthrough third-party link, e.g. serialline, microwave link, the Internet, . . .
• Third-party link requires own frameformat
• Approach: a bridge encapsulates aframe from LAN A into a frameappropriate for third-party link
• Receiving bridge decapsulatesframe and puts it on LAN B
• When is this useful?
LANs MAC Bridges, Switches Bibliography
A Larger Network Example
(Example taken from [44, Fig. 15.10])
• Packets between Stn1 and Stn7traverse two bridges
• Between Stn1 and Stn5 two differentpathes exist!
• Providing different pathes is useful toprovide fault-tolerance andload-balancing
• Only one bridge (Br1 or Br7) shouldforward packet from Stn1 to Stn5 toavoid duplicate packets on LAN E
• We have a routing problem!
LANs MAC Bridges, Switches Bibliography
A Larger Network Example (2)
(Example taken from [44, Fig. 15.10])
• Fixed routing approach: each bridgepossesses for each incominginterface a table indicating whether aframe to dst should be forwardedand to which outgoing interface / LAN
• Problem: table needs to berecomputed and re-distributed uponevery change in topology
• Does not scale well to largeinstallations
LANs MAC Bridges, Switches Bibliography
Spanning Tree Approach
• The spanning tree approach addresses automatic
construction and maintenance of forwarding tables by
• For each port / attached LAN a bridge maintains twoinformations:
• A forwarding table• A flag indicating if port is in blocking or forwarding state
• Forwarding table contains:
• all MAC addresses which can be reached (directly or
indirectly) by sending to this port• A timer for each stored MAC address
• Example: for bridge Br2 (see previous slides)
• all stations in LANs A, B, D, and E on upper port• all stations in LANs C, F and G on lower port
LANs MAC Bridges, Switches Bibliography
Spanning Tree Approach – Frame Forwarding (2)
• Suppose a bridge receives frame to dst on port x
• Bridge checks forwarding tables on all other ports than x
• If dst is not found, bridge sends frame to all ports in
forwarding state except x
• If dst is found on port y and port y is in forwarding state,
the frame is sent to port y , otherwise (y not in forwarding
state) the frame is dropped
LANs MAC Bridges, Switches Bibliography
Spanning Tree Approach – Address Learning
• Suppose a frame from station src arrives on port x
• The bridge then checks:
• If no entry for src exists in the forwarding table for x , then it
is added and a timer is started• If already an entry for src exists on port x and the timer is
running, the timer is canceled and re-started
• If the timer for src at port x expires, the entry for src and
its timer are deleted from forwarding table of x
• This usage of timers is called soft state!
• Why is this done?• Soft-state is a fairly common mechanism in many protocols!
LANs MAC Bridges, Switches Bibliography
Spanning Tree Approach – Loop Resolution
(Example taken from [44, Fig. 15.11])
• Suppose initially all forwarding tablesare empty
• At time t0 station Stn1 sends a frameto Stn2 using LAN A
• Both bridges receive frame in paralleland forward to LAN B, bridge Br1 attime t1 and bridge Br2 at time t2 > t1
• At time t1 bridge Br2 receives aframe with Stn1’s source address onLAN B, at time t2 the same happensto Br1
• Effect: Stn2 receives the same frametwo times
• Effect: Br1 and Br2 have Stn1included in forwarding tables for bothports!!
• Question: what happens if next Stn2sends a frame to Stn1?
LANs MAC Bridges, Switches Bibliography
Spanning Tree Approach – Loop Resolution (2)
• To avoid this kind of loops, IEEE 802.1D specifies the
spanning tree protocol
• Approach:
• Each bridge is equipped with an individual MAC address• A cost value is administratively assigned to each bridge• Bridges run a dedicated protocol among each other,
exchanging information about network topology• When topology is fully discovered, a minimum-weight
(related to per-bridge costs) spanning tree is computed
• In the computation LANs are taken as vertices and bridges
are taken as edges in the graph!!
• Spanning-tree computation can result in “removal” of
possible connections, the corresponding bridge ports are
set to state blocking• Tree is re-calculated upon changes in topology
LANs MAC Bridges, Switches Bibliography
Layer-2 Switches
• A switch is a centralized element,forwarding frames only to thecorrect output port
• Stations are attached to switch viapoint-to-point links with separatetransmit/receive lines (full-duplex)
• No broadcast medium anymore!
• A switch is able to process frames todistinct destinations in parallel,switches can therefore increasenetwork capacity as compared toLANs with broadcast medium
• Frames arriving in parallel for thesame destination are buffered(output buffering)
• Switches are transparent to stations
• Nowadays almost all Ethernetinstallations use switches
LANs MAC Bridges, Switches Bibliography
Layer-2 Switches (2)
• Difference to a hub:
• A hub builds a broadcast medium, only one station can
transmit at a time without collisions• A switch can accept up to N parallel transmissions, where
N is the number of stations in the LAN• Each attached station can receive packets at the full
medium capacity
Important Point
Switches remove the “shared medium” assumption and the
need for a MAC, but now the stations contend for the resources
of the switch (switching capacity, buffer memory)!
LANs MAC Bridges, Switches Bibliography
Layer-2 Switches (3)
• Operation modes of switches:
• Store-and-forward: switch receives a packet fully, checks
frame for correctness, reads off destination address,
determines outgoing port and transmits packet there• Cut-through-switch: switch starts forwarding to output
port already after having read the address field (appears
very early in most frame formats!), no check for frame
correctness
• Switches can be cascaded and more complex
infrastructures (including loops) can be built
• Switches often incorporate the same loop removal
technique as bridges
LANs MAC Bridges, Switches Bibliography
Norman Abramson.Development of the ALOHANET.IEEE Transactions on Information Theory, 31(2):119–123, March 1985.
Norman Abramson, editor.Multiple Access Communications – Foundations for Emerging Technologies.IEEE Press, New York, 1993.
Norman Abramson.Multiple Access in Wireless Digital Networks.Proceedings of the IEEE, 82(9):1360–1370, September 1994.
Ian F. Akyildiz, Janise McNair, Loren Carrasco, and Ramon Puigjaner.Medium access control protocols for multimedia traffic in wireless networks.IEEE Network Magazine, 13(4):39–47, 1999.
Mostafa H. Ammar and George N. Rouskas.On the performance of protocols for collecting responses over a multiple-accesschannel.IEEE Transactions on Communications, 43(2):412–420, February 1995.
Guiseppe Anastasi, Luciano Lenzini, Enzo Mingozzi, Andreas Hettich, andAndreas Krämling.Mac protocols for wideband wireless local access: Evolution towards wirelessatm.IEEE Personal Communications, 5(5):53–64, October 1998.
LANs MAC Bridges, Switches Bibliography
D. Bertsekas and R. Gallager.Data Networks.Prentice Hall, Englewood Cliffs, New Jersey, 1987.
J. I. Capetanakis.Tree Algorithm for Packet Broadcast Channels.IEEE Transactions on Information Theory, 25(5):505–515, September 1979.
Charles Chien, Mani B. Srivastava, Rajeev Jain, Paul Lettieri, Vipin Aggarwal,and Robert Sternowski.Adaptive Radio for Multimedia Wireless Links.IEEE Journal on Selected Areas in Communications, 17(5):793–813, May 1999.
Lou Dellaverson and Wendy Dellaverson.Distributed channel access on wireless atm links.IEEE Communications Magazine, 35(11):110–113, November 1997.
Andras Farago, Andrew D. Myers, Violet R. Syrotiuk, and Gergely V. Zaruba.Meta-MAC Protocols: Automatic Combination of MAC Protocols to OptimizePerformance for Unknown Conditions.IEEE Journal on Selected Areas in Communications, 18(9):1670–1681,September 2000.
Robert G. Gallager.A Perspective on Multiaccess Channels.IEEE Transactions on Information Theory, 31(2):124–142, March 1985.
LANs MAC Bridges, Switches Bibliography
Jonathan Goodman, Albert G. Greenberg, Neal Madras, and Peter March.Stability of binary exponential backoff.Journal of the ACM, 35(3):579–602, 988.
Ajay Chandra V. Gummalla and John O. Limb.Wireless medium access control protocols.IEEE Communications Surveys and Tutorials, 3(2):2–15, 2000.http://www.comsoc.org/pubs/surveys.
Boudewijn R. Haverkort.Performance of Computer Communication Systems – A Model Based Approach.John Wiley and Sons, Chichester / New York, 1998.
A. Hoffmann, R. J. Haines, and A. H. Aghvami.Performance analysis of a token based MAC protocol with asymmetric pollingstrategy (’TOPO’) for indoor radio local area networks under channel outageconditions.In Proc. International Conference on Communications (ICC), pages 1306–1311,New Orleans, Louisiana, 1994. IEEE.
IEEE.802.4 Token-passing Bus Access Method, 1985.
IEEE.802.5 Token Ring Access Method and Physical Layer Specifications, 1985.
IEEE Computer Society.
LANs MAC Bridges, Switches Bibliography
802.1D – IEEE Standard for Local and Metropolitan Area Networks – MediaAccess Control (MAC) Bridges, June 2004.
IEEE Computer Society.IEEE Standard for Information technology – Telecommunications and informationexchange between systems – Local and metropolitan area networks – Specificrequirements – Part 3: Carrier sense multiple access with collision detection(CSMA/CD) access method and physical layer specifications, December 2005.
IEEE Computer Society – Sponsored by the LAN/MAN Standards Committee.IEEE Standard for Information technology – Telecommunications and informationexchange between systems – Local and metropolitan area networks – Specificrequirements – Part 15.1: Wireless Medium Access Control (MAC) and PhysicalLayer (PHY) Specifications for wireless personal area networks (WPANs), June2005.
IEEE Computer Society, sponsored by the LAN/MAN Standards Committee.IEEE Standard for Information technology – Telecommunications and InformationExchange between Systems – Local and Metropolitan Area Networks – SpecificRequirements – Part 11: Wireless LAN Medium Access Control (MAC) andPhysical Layer (PHY) Specifications, 2007.
Hong ju Moon, Hong Seong Park, Sang Chul Ahn, and Wook Hyun Kwon.Performance Degradation of the IEEE 802.4 Token Bus Network in a NoisyEnvironment.Computer Communications, 21:547–557, 1998.
LANs MAC Bridges, Switches Bibliography
Mark J. Karol, Z. Liu, and K.Y. Eng.An efficient demand-assignment multiple access protocol for wireless (atm)networks.Wireless Networks, 1(3), 1995.
Leonard Kleinrock and Fouad A. Tobagi.Packet switching in radio channels: Part I carrier sense multiple access modelsand their throughput-/delay-characteristic.IEEE Transactions on Communications, 23(12):1400–1416, 1975.
J. F. Kurose, M. Schwartz, and Y. Yemini.Multiple-access protocols and time-constrained communication.ACM Computing Surveys, 16:43–70, March 1984.
Byung-Jae Kwak, Nah-Oak Song, and Leonard E. Miller.Performance Analysis of Exponential Backoff.IEEE/ACM Transactions on Networking, 13(2):343–355, April 2005.
S. S. Lam.Multiaccess protocols in computer communications. volume I: Principles.In W. Chon, editor, Principles of Communication and Network Protocols, pages114–155. Prentice-Hall, Englewood Cliffs, NJ, 1983.
LAN/MAN Standards Committee of the IEEE Computer Society.IEEE Standard for Information technology – Telecommunications and informationexchange between systems – Local and metropolitan area networks – Specificrequirements – Part 15.4: Wireless Medium Access Control (MAC) and Physical
LANs MAC Bridges, Switches Bibliography
Layer (PHY) Specifications for Low Rate Wireless Personal Area Networks(LR-WPANs), September 2006.revision of 2006.
Shu Lin and Daniel J. Costello.Error Control Coding.Prentice-Hall, Englewood Cliffs, New Jersey, second edition, 2004.
Shu Lin, Daniel J. Costello, and Michael J. Miller.Automatic-Repeat-Request Error-Control Schemes.IEEE Communications Magazine, 22(12):5–17, December 1984.
Hang Liu, Hairuo Ma, Magda El Zarki, and Sanjay Gupta.Error control schemes for networks: An overview.MONET – Mobile Networks and Applications, 2(2):167–182, 1997.
Biswanath Mukherjee.Optical WDM Networks.Optical Networks Series. Springer, New York, 2006.
Andrew D. Myers and Stefano Basagni.Wireless media access control.In Ivan Stojmenovic, editor, Handbook of Wireless Networks and MobileComputing, pages 119–143. John Wiley & Sons, New York, 2002.
The Editors of IEEE 802.IEEE 802.2, ISO/IEC 8802-2: Local Area Networks: Logical Link Control, 1989.
LANs MAC Bridges, Switches Bibliography
Nikos Passas, Sarantis Paskalis, Dimitri Vali, and Lazaros Merakos.Quality-of-service-oriented medium access control for wireless atm networks.IEEE Communications Magazine, 35(11):42–50, November 1997.
Radia Perlman.Interconnections Second Edition – Bridges, Routers, Switches andInternetworking Protocols.Addison-Wesley, Reading, Massachusetts, 1999.
Larry L. Peterson and Bruce S. Davie.Computer Networks – A Systems Approach.Morgan Kaufmann, San Francisco, fourth edition, 2007.
Theodore S. Rappaport.Wireless Communications – Principles and Practice.Prentice Hall, Upper Saddle River, NJ, USA, 2002.
Izhak Rubin.Access-Control Disciplines for Multi-Access Communication Channels:Reservation and TDMA Schemes.IEEE Transactions on Information Theory, 25(5):516–536, September 1979.
Izhak Rubin.Multiple access methods for communications networks.In Jerry D. Gibson, editor, The Communications Handbook, pages 622–649. CRCPress / IEEE Press, Boca Raton, Florida, 1996.
LANs MAC Bridges, Switches Bibliography
Izhak Rubin and L. F. M. de Moraes.Message Delay Analysis for Polling and Token Multiple-Access Schemes forLocal Communication Networks.IEEE Journal on Selected Areas in Communications, 1(5):935–947, 1983.
Oran Sharon and Eitan Altman.An efficient polling mac for wireless lans.IEEE/ACM Transactions on Networking, 9(4):439–451, August 2001.
William Stallings.Data and Computer Communications.Prentice Hall, Englewood Cliffs, New Jersey, fourth edition, 2006.
Hideaki Takagi.Analysis of Polling Systems.MIT Press, Cambridge, Massachusetts, 1986.
Hideaki Takagi.Queueing analysis of polling models: an update.In Hideaki Takagi, editor, Stochastic Analysis of Computer and CommunicationSystems, pages 267–318. Elsevier, Amsterdam, 1990.
Andrew S. Tanenbaum.Computer Networks.Prentice-Hall, Englewood Cliffs, New Jersey, third edition, 1997.
Fouad A. Tobagi.
LANs MAC Bridges, Switches Bibliography
Multiaccess protocols in packet communications systems.IEEE Transactions on Communications, 28:468–488, 1980.
Fouad A. Tobagi and Leonard Kleinrock.Packet switching in radio channels: Part II the hidden terminal problem in csmaand busy-tone solutions.IEEE Transactions on Communications, 23(12):1417–1433, 1975.
Fouad A. Tobagi and Leonard Kleinrock.Packet switching in radio channels: Part III – polling and (dynamic) split-channelreservation multiple access.IEEE Transactions on Communications, 24(8):832–845, August 1976.
Don Towsley and J. K. Wolf.On adaptive tree polling algorithms.IEEE Transactions on Communications, 32(12):1294–1298, 1984.
David Tse and Pramod Viswanath.Fundamentals of Wireless Communications.Cambridge University Press, Cambridge, UK, 2005.
Harmen R. van As.Media access techniques: The evolution towards terabit/s LANs and MANs.Computer Networks and ISDN Systems, 26:603–656, 1994.
George Varghese and Radia Perlman.Transparent Interconnection of Incompatible Local Area Networks Using Bridges.
LANs MAC Bridges, Switches Bibliography
IEEE Journal on Selected Areas in Communications, 8(1):1565–1575, January1990.
Andreas Willig and Adam Wolisz.Ring stability of the PROFIBUS token passing protocol over error prone links.IEEE Transactions on Industrial Electronics, 48(5):1025–1033, October 2001.
IEEE Computer Society.IEEE Standard for Information technology – Telecommunications and informationexchange between systems – Local and metropolitan area networks – Specificrequirements – Part 3: Carrier sense multiple access with collision detection(CSMA/CD) access method and physical layer specifications, December 2005.
K. K. Ramakrishnan and Henry Yang.The ethernet capture effect: Analysis and solution.In Proc. 19th Conference on Local Computer Networks (LCN’94), Minneapolis,USA, October 1994.
William Stallings.Data and Computer Communications.Prentice Hall, Englewood Cliffs, New Jersey, fourth edition, 2006.
• Understand that bit- and packet-errors are a fact of life in
virtually all networks• Know the two fundamental types of error-control strategies
• Literature:
• Books on coding: [13], [17], [18], [4], [20], [16]• Interesting papers on coding: [5], [7], [23], [28]• ARQ and general error control: [15], [12], [11], [14]• This module is in parts based on [13]
• Each bit is flipped independently ofothers with probability p ∈ (0, 1),called bit error rate (BER)
• A packet with n bits is regarded aserroneous when at least one bit isflipped
• The packet error rate (PER) is thus:
P(p, n) = 1 − (1 − p)n
• Figure shows PER for varying BER(computed as 10b , with b being theBER exponent on x-axis) for packetswith 100 bits overhead (header,trailer) and varying # of user bits
• With error-detection coding redundancy is added to apacket so that:
• Certain error patterns can be detected reliably• Other error patterns can be detected with high probability• No information about the position of errors in a packet can
be inferred (and hence no correction can be done)
• Error-detecting codes serve as a packet checksum andare used in ARQ schemes:
• Tx computes checksum as function of header and data• Tx attaches checksum to packet and transmits both• Receiver computes own checksum (with same algorithm)
over (received) header and data• Receiver compares own checksum with the one received• If equal, packet is accepted and positive feedback is sent• Otherwise, negative feedback is provided to Tx
• The rule for multiplication can be obtained from expanding f (X) · g(X) andsumming up (according to the rules of GF(2)!!) the terms for the same power
• We have
f (X) · g(X) = c0 + c1 · X + c2 · X 2 + . . .+ cn+m · X n+m
with
c0 = f0 ∗ g0
c1 = f0 ∗ g1 + f1 ∗ g0
c2 = f0 ∗ g2 + f1 ∗ g1 + f2 ∗ g0
. . .
ck = f0 ∗ gk + f1 ∗ gk−1 + . . .+ fk ∗ g0
. . .
cn+m = fn ∗ gm
where the right-hand-sides are computed according to GF(2) rules
• They can also be implemented efficiently in software
(linear time in the number of message bits) [19], [21], [9]
Important Point
There is always a residual error rate, i.e. some probability that
errors are not detected by a CRC checksum!!
• Intuitive justification: when the number of checkbits is smaller than the number ofmessage bits, several messages are mapped to the same checksum. An errorpattern turning one of these messages into another one cannot be detected
• In many cases the residual error probability (especially for 32 bit CRCs) is prettysmall and errors can be neglected
• Transmitter must buffer packets for possible retransmission• Feedback channel needs bandwidth as well• Even for very few bit errors whole packet is retransmitted
• ARQ protocols differ:
• in the number of allowed outstanding frames /
unacknowledged frames• in the buffering requirements at receiver / transmitter• in the way feedback is provided (positive / negative
acknowledgement frames, timers)• in their maximum throughput under error conditions
• We discuss basic ARQ schemes, lots of variations!!
• The alternating bit protocol (ABP) [2] is the simplest of the
“serious” ARQ protocols
• It is also often referred to as send-and-wait
• Properties:
• guarantees in-sequence delivery if round-trip time is
bounded and timeout is chosen appropriately• simple to implement• requires one buffer at transmitter and one buffer at receiver• is reasonably efficient over links with propagation delays
• Positive acknowledgements:• Receiver receives packet with seqno s
• Receiver sends ACK packet with seqno s
• Semantics: “i have successfully received this packet s”• Modified semantics for cumulative positive
acknowledgments: “i have successfully received this packet
s and all previous packets”
• Negative acknowledgement (Example):• Receiver receives packet with seqno s, previous received
packet had seqno s − 2• Receiver sends NACK packet with seqno s − 1• Semantics: “i have not received packet s − 1”• More generally, a NACK is issued when receiver notices
that some packet has not been successfully received• Can you imagine other methods to detect a failure when
• constant overhead even without errors on the channel• constant throughput (if all errors can be corrected)• constant delay• variable residual error rate
• ARQ has:
• variable overhead: retransmissions occur only in case of
errors• variable delays (due to retransmissions)• very low residual error rate (determined by CRC quality and
Haowei Bai and Mohammed Atiquzzaman.Error modeling schemes for fading channels in wireless communications: Asurvey.IEEE Communications Surveys and Tutorials, 5(2):2 – 9, 2003.http://www.comsoc.org/livepubs/surveys.
K.A. Bartlett, R.A. Scantlebury, and P.T. Wilkinson.A note on reliable full-duplex transmission over half duplex lines.Communications of the ACM, 12(5):260ff, 1969.
D. Bertsekas and R. Gallager.Data Networks.Prentice Hall, Englewood Cliffs, New Jersey, 1987.
Ezio Biglieri.Coding for Wireless Channels.Springer, New York, 2005.
Leon Cohen.The history of noise – on the 100th anniversary of its birth.IEEE Signal Processing Magazine, 22(11):20–26, November 2005.
Thomas M. Cover and Joy A. Thomas.Elements of Information Theory.John Wiley & Sons, New York, second edition, 2006.
Victor DeBrunner, Linda DeBrunner, Longji Wang, and Sridhar Radhakrishnan.Error control and concealment for image transmission.
IEEE Communications Surveys and Tutorials, 3(1), 2000.http://www.comsoc.org/livepubs/surveys.
E. O. Elliot.Estimates of error rates for codes on burst-noise channels.Bell Systems Technical Journal, 42:1977–1997, September 1963.
David C. Feldmeier.Fast Software Implementation of Error Detection Codes.IEEE/ACM Transactions on Networking, 6(6):640–651, December 1995.
E. N. Gilbert.Capacity of a burst-noise channel.Bell Systems Technical Journal, 39:1253–1265, September 1960.
David Haccoun and Samuel Pierre.Automatic repeat request.In Jerry D. Gibson, editor, The Communications Handbook, pages 181–198. CRCPress / IEEE Press, Boca Raton, Florida, 1996.
Samir Kallel.Efficient hybrid arq protocols with adaptive forward error correction.IEEE Transactions on Communications, 42(2):281–289, February 1994.
Shu Lin and Daniel J. Costello.Error Control Coding.Prentice-Hall, Englewood Cliffs, New Jersey, second edition, 2004.
Shu Lin, Daniel J. Costello, and Michael J. Miller.Automatic-Repeat-Request Error-Control Schemes.IEEE Communications Magazine, 22(12):5–17, December 1984.
Hang Liu, Hairuo Ma, Magda El Zarki, and Sanjay Gupta.Error control schemes for networks: An overview.MONET – Mobile Networks and Applications, 2(2):167–182, 1997.
David J. C. MacKay.Information Theory, Inference, and Learning Algorithms.Cambridge University Press, Cambridge, UK, 2003.
Arnold M. Michelson and Allen H. Levesque.Error-Control Techniques for Digital Communication.John Wiley and Sons, New York, 1985.
Robert H. Morelos-Zaragoza.The Art of Error Correcting Coding.John Wiley & Sons, Chichester, UK, second edition, 2004.
Tenkasi V. Ramabadran and Sunil S. Gaitonde.A Tutorial on CRC Computations.IEEE Micro, 8(4):62–75, August 1988.
Tom Richardson and Ruediger Urbanke.Modern Coding Theory.Cambridge University Press, Cambridge, Massachusetts, 2008.
Dilip V. Sarwate.Computation of Cyclic Redundandy Checks via Table Look-Up.Communications of the ACM, 31(8):1008–1013, August 1988.
Claude E. Shannon.A mathematical theory of communication.Bell Systems Technical Journal, 27:379–423, 623–656, July, October 1948.
Bernard Sklar.A primer on turbo code concepts.IEEE Communications Magazine, 35(12):94–102, December 1997.
William Stallings.Data and Computer Communications.Prentice Hall, Englewood Cliffs, New Jersey, fourth edition, 2006.
Jonathan Stone, Michael Greenwald, Craig Partridge, and James Hughes.Performance of checksums and crc’s over real data.IEEE/ACM Transactions on Networking, 6(5):529–543, 1998.
Andrew S. Tanenbaum.Computer Networks.Prentice-Hall, Englewood Cliffs, New Jersey, third edition, 1997.
H.S. Wang and N. Moayeri.Finite State Markov Channel - A Useful Model for Radio CommunicationChannels.IEEE Transactions on Vehicular Technology, 44(1):163–171, February 1995.
Please note that cost is a more generic term than any of
the mentioned examples
• Interpretation as available resources, e.g.:
• Number of available phone trunks• Currently available capacity, given the set of flows that
already use this link
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Fundamental task of routing
• Given a network G = (V ,E) , and given a fixed source
s ∈ V and destination node d ∈ V
• An m-hop path between source and destination is asequence of edges (i0, i1), (i1, i2), . . . , (im−1, im), so thati0 = s and im = d
• Alternative notation: i0 − i1 − . . .− im
Major task
For each source-destination pair in a network identify one or
more paths that are optimal (or at least of reasonable quality) in
some pre-defined sense.
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Shortest-Path Routing
GoalThe goal of shortest-path routing algorithms is to select the
path that has the smallest total cost. To compute the total cost
of a path the costs of all its links are added.
• Routing in the Internet uses shortest-path routing
• But this is more complicated, though . . .
• Special case: minimum-hop routing is obtained when all
link costs are the same (e.g. = 1)
• Shortest-path routing is also known as least-cost routing
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Widest-Path Routing
• Some networks judge the cost or value of a path based on
a non-additive property
• Example: dynamic call routing in POTS:
• Assume that for each network link we maintain the residualcapacity available on this link
• The residual capacity of a path is defined as the minimum
residual capacity of all the links on it• The goal is then to find the path with the maximum residual
capacity, since routing a new phone call on this path does
least likely create a bottleneck for future calls
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Judgement Criteria
• Effectiveness: when a route between two nodes exists,
the routing algorithm / protocol should be able to find it
• Correctness: computed routes should be valid paths that
contain no circles (i.e. are loop-free)
• Simplicity: routing algorithms / protocols should be
computationally simple and require only little information
exchange among routers
• Robustness: a routing protocol must be able to cope with:
• link or station failures• newly established links or stations• changes in link metrics• congestion situations
by establishing new routes when old ones become
infeasible or are no longer optimal
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Judgement Criteria (2)
• Stability: a routing protocol should not recomputeeverything upon minor changes in the network
• There is a tension between stability and robustness!
• Fairness: all users should be treated in the same way
• Optimality: different criteria, depending on perspective:
• Provider perspective: the network should carry as many
connections / packet flows as possible (maximizes revenue)• User perspective: generated routes should be “short”, “fast”
and offer good throughput
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Classification Criteria for Routing Protocols
• Decision time (i.e. when are routing decisions made)
• For each packet (timescale of ms and below)• For each session / call (timescale of seconds to minutes)• At network configuration time (timescale of months / years)
• Decision place:
• Originating node / source (Source routing)• Central node (centralized routing)• Each node (distributed routing)
• Information used in decision:
• None• Local information (to a station)• Information from adjacent nodes (and local information)• Information from all nodes along a route• Information from all nodes in the network
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Classification Criteria for Routing Protocols (2)
• Information update frequency:• Periodic• Upon major load change or topology change• Both
• Information update initiation:• Push: a node transmits information updates to its neighbors
on its own initiative• Pull: a node asks his neighbors (using request-response
exchange) for new information updates
• Information exchange channel:• In-band: routing information is exchanged on the same
network / channel as user data• Example: In the Internet routing protocols run on top of IP
• Out-of-band: routing information is transmitted on separatenetwork, no resource sharing at all with user data
• Example: in the POTS routing messages are exchanged
over separate network using the SS7 protocol
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Routing Algorithms and Routing Protocols
• A routing algorithm solves routing problem in centralized
fashion, assuming full network information is available
• A routing protocol embeds a routing algorithm into a realnetworking context:
• It operates in a distributed environment• It incorporates explicit information exchange among nodes• Information exchange takes time and might fail, the protocol
must consider these possibilities
• A routing protocol mainly specifies which information is
exchanged between stations (and when), it is not
necessarily tied to any specific routing algorithm
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Forwarding Table
• A forwarding table within a router maps to eachdestination address either:
• an outgoing interface (next-hop routing)• a full route to destination, which is then added to a packet
(source routing) and obeyed by all nodes on the path
Routing in the Internet uses next-hop routing
• The forwarding table:
• results from the execution of the routing protocol (dynamicrouting), or can be static / preconfigured (static routing)
• is changed on relatively large timescales, e.g. upon
topology changes, load changes or changes in metrics• is consulted for every packet
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Fundamentals
Some “Unusual” Routing Protocols
Shortest-Path Algorithms
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Hot-Potato Routing
• Rule: a router transmits a packet on the output link
currently having shortest queue / highest capacity / . . .
• Benefits:
• computationally simple• uses local information• no exchange of routing information required
• Drawbacks:
• No guarantees at all can be given
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Randomized Routing
• Rule: a router transmits a packet on a randomly chosen
outgoing interface
• Benefits:
• Computationally simple• no exchange of routing information required• In a finite connected network this algorithm is guaranteed to
hit the destination node with probability one in absence of
link errors, congestion, etc.
• Drawbacks:
• Actual paths taken can be very long• Delays can be very long• Many hops give many opportunities for loosing packet
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Flooding
• Rule: a router transmits a packet on all interfaces, exceptthe one it was received on
• A packet can arrive multiple times at destination or router• Router uses unique packet identifier (e.g. source address
and seqno) to avoid delivering duplicate data• Routers need these identifiers to avoid forwarding a packet
more than once (i.e. avoiding self-amplifying “explosion”)
• Benefits:
• simplicity, robustness, stability, . . .• requires no routing computations, no information exchange
• Drawbacks
• Extreme waste of resources• Security issue: all stations in the network get the packet
• Flooding can be an interesting option in networks where
data is transmitted only very rarely
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Introduction
• We discuss two shortest-path routing algorithms:
• Bellman-Ford• Dijkstra
There are other algorithms available, e.g. Floyd-Warshall
• See also [4]
• Both algorithms are centralized, i.e. they require that the
full information about network topology (nodes, edges and
metrics) is available to the algorithm
• Both algorithms play a prominent role in Internet routing
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Some Notations
• Given a network G = (V ,E) with N = |V | stations
• i ∈ V and j ∈ V refer to some generic nodes / stations in
the network
• di,j is the direct link cost / metric between i and j , with:
• 0 ≤ di,j < ∞ when i and j are adjacent nodes• di,j = ∞ when i and j are non-adjacent nodes
• Di,j represents the total cost of the minimum cost path from
i to j in the Bellman-Ford algorithm, over one or multiple
hops, according to i ’s current knowledge
• Di,j represents the same thing for Dijkstra’s algorithm
• Ni represents the set of nodes adjacent to node i , i.e.
Ni = k ∈ V (i , k) ∈ E
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Some Notations (2)
• In this example we have
d4,6 = 15, but D4,6 = D4,6 = 2
(by choosing the path 4 − 3 − 6)
• Furthermore, d1,6 = ∞, but
D1,6 = 3 (by choosing the path
1 − 4 − 3 − 6)
• We have N5 = 3, 4, 6
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Bellman-Ford Algorithm
Dijkstra Algorithm
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Basic Idea
• B-F follows the dynamic programming principle [1], [2]
• We want to find a shortest route from s ∈ V to d ∈ V
• The following equations must be satisfied:
¯Ds,s = 0
¯Ds,d = mink∈Nd
Ds,k + dk ,d , for s 6= d
• Explanation: suppose node s already knows its least costs
Ds,k to the neighbors k ∈ Nd of d , then s’s least cost to d
is the minimum over all neighbors k of the costs Ds,k plus
the direct costs dk ,d
• But: how is Ds,k known and how to turn this into an
algorithm?
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Approach
• In the Bellman-Ford algorithm the costs between a source
node s and all destination nodes d are computed iteratively
• The iterations are over the number of hops that packets
can take
• Change in notation: D(h)s,d gives the smallest cost among all
pathes between s and d that have at most h hops
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
A Simplified Bellman-Ford Algorithm
/ / Computes f o r a f i x e d node s the d is tances and the r o u t i n g/ / t r ee to a l l o ther nodes . Graph can be d i r ec ted or und i rec ted
/ / i n i t i a l i z a t i o n
D(0)s,s = 0 ; pred [ s ] = s ;
f o r a l l d wi th d 6= s do
D(0)s,d
= ∞ ; pred [ d ] = NULL ;
/∗ loop over a l l numbers o f hops ∗ /for h = 1 . . .N do :
D(h)s,s = 0
f o r a l l d 6= s do :
D(h)s,d
= mink∈NdD
(h−1)s,k
+ dk,d
pred [ d ] = k∈NdD
(h−1)s,k
+ dk,d
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
A Second Version
/ / Computes f o r a f i x e d node s the d is tances and the r o u t i n g/ / t r ee to a l l o ther nodes . Graph i s assumed to be d i r ec ted
/ / i n i t i a l i z a t i o n
Ds,s = 0 ; pred [ s ] = s ;f o r a l l d wi th d 6= s do
Ds,d = ∞ ; pred [ d ] = NULL ;
/∗ loop over a l l numbers o f hops ∗ /for h = 1 to N − 1 do :
foreach (v ,w) ∈ E do
when Ds,v + dv,w < Ds,w then
Ds,w = Ds,v + dv,w ;pred [ w ] = v
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Comments
• The runtime of the algorithm for a single source is
O(|V | · |E |), for a whole network it becomes O(|V |2 · |E |)
• The algorithm shown is a simplified version of
Bellman-Ford that can handle only non-negative weights
• The algorithm can be extended to handle negative weights
as well, as long as no negative cycles are contained
• It is a centralized algorithm, complete network information
(di,j ) must be available at execution time
QuestionWhat is pred good for? What can you read off from it?
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Bellman-Ford Algorithm
Dijkstra Algorithm
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Basic Idea
• Dijkstra’s algorithm is restricted to graphs with
non-negative weights
• It is greedy: in every situation it makes the choice that is
currently the best, without regard to future situations
• Here:
• The algorithm maintains a list S ′ of nodes that have not yet
been considered• In each step it removes k ∈ S ′ to which the source s has
the smallest known distance Ds,k
• For each neighbor x of k it is then checked if a path through
k to x is shorter than best so-far known path to x
• Remember that nodes are numbered from 1 to N, i.e.
V = 1, . . . ,N
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
The Dijkstra Algorithm
/ / Computes f o r a f i x e d node s the d is tances and the r o u t i n g/ / t r ee to a l l o ther nodes . Graph i s assumed to be d i r ec ted
/ / i n i t i a l i z a t i o nS′ = V \ sDs,s = 0 ; pred [ s ] = s
f o r a l l d ∈ S′ doDs,d = ds,d ; pred [ d ] = NULL ;
when ds,d < ∞pred [ d ] = s
/ / main loopwhile S′ 6= ∅ do
k =m∈S′ Ds,m
S′ = S′ \ kfor j ∈ Nk do
when Ds,k + dk,j < Ds,j
Ds,j = Ds,k + dk,j
pred [ j ] = k
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Comments
• The worst-case runtime of Dijkstra’s algorithm for a single
node is O(N2), but can be better for sparse graphs
• Dijkstra cannot handle negative metrics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Protocol Operation
Problems
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Introduction
• The presentation here follows [6, Chap. 3]
• We want to turn the centralized Bellman-Ford algorithm
into a distributed protocol where nodes communicate only
with adjacent nodes
• For such a protocol we have to clarify:
• What kind of messages do nodes send to their neighbors,
what information is carried in them?• How often / when should this information be sent?
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Basic Approach
• Previously we stated that the costs for the least cost routes
between source s and destination d satisfy:
¯Ds,s = 0
¯Ds,d = mink∈Nd
Ds,k + dk ,d , for s 6= d
• Observe here that Ds,k refers to a neighbor k of the
destination d
• A similar relationship must also hold for neighbors of s:
¯Ds,s = 0
¯Ds,d = mink∈Ns
ds,k + Dk ,d , for s 6= d
• What have we gained here?
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Basic Approach (2)
• In the second form node s just uses information that:
• it has itself (s knows Ns and ds,k for direct neighbors)• it can obtain from direct neighbors (Dk,d , for k ∈ Ns)
• This gives hint: each node i transmits a vector, containingall values Di,d(t) it knows at time t , to its neighbors
• By this rule, node s receives Dk,d (t) from all its neighbors k• Upon receiving a value Dk,d (t) from a neighbor k , node s
can re-compute its own least-cost path to d by checking
whether Dk,d (t) + ds,k is smaller than currently known
least-cost – if so, node s stores k as next-hop for d• Some time later node s in turn transmits own vector with all
Ds,d (t), propagating changes further to downstream nodes• A node sends an updated version of its vector each time it
receives new information, or periodically (or both)• Over time, a node s receives sufficient vectors to have a
view on the whole network
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Basic Approach (3)
• Note that initially a node s does not need to know the
whole network, it only needs Ns and ds,k for all k ∈ Ns
• Node addressing is handled outside the protocol
• For each destination address d , node s stores the next hop
and the least cost / distance
• Since nodes transmit a vector containing their distances
Ds,d to all known destinations d , this approach is called
distance-vector protocol
• Some of the Internets routing protocols are based on thisapproach, for example:
• RIP and RIP-2• BGP (uses variant of DV, named path vector routing)
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
DV Protocol Details
• In the following, let Dsk ,d(t) be the minimum cost from node
k to node d , as it is available to s at time t• Rationale for time dependency: it may take time for node k
to inform node s about changes in its least-cost values• Possible reasons:
• Processing delays at k , transmission delays• Node k transmits new cost vectors to some other node v
before transmitting it to s
• A protocol message sent by node i at time t has format:
Here:• Id= i indicates that i is the sender• a record Dst=d,Cost=c indicates that node i ’s current
least-cost path to node d has total costs of c• Node i includes such records for all destinations d it is
currently aware of
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
DV Protocol Details (2)
/ / I n i t i a l i z a t i o n/ / Node i s conf igured wi th unique node id , e . g . s
Ds,s = 0foreach k ∈ Ns do
Ds,k = ds,k
nexthop [ k ]=k
/ / p e r i o d i c t ransmiss ion o f own tab l e to neighbors (DV messages )on r e c e i v i n g t ransmi t−t imer do
t r ansm i t towards each k ∈ Ns the l i s t o f c u r r e n t l y \known d e s t i n a t i o n s and t h e i r most recent l e a s t costs
r e s t a r t t ransmi t−t imer
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
DV Protocol Details (3)
/ / recep t ion o f DV update from neighborson r e c e i v i n g DV message from neighbor k at t ime t do
when message conta ins new d e s t i n a t i o n d then
Ds,d = ds,k + Dsk,d
(t)
nexthop [ d ]=kforeach d e s t i n a t i o n d mentioned i n k ’ s DV message do
s to re Dsk,d
(t)
foreach d e s t i n a t i o n d known to s dowhen nexthop [ d ]=k then
Ds,d = ds,k + Dsk,d
(t)
/ / rou te computat ionforeach d e s t i n a t i o n d known to s do
foreach neighbor m do
when ds,m + Dsm,d
(t) < Ds,d then
Ds,d = ds,m + Dsm,d
(t)
nexthop [ d ]=m
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
DV Protocol Details (4)
/ / spec ia l cases
/ / a l i n k to a neighbor goes down / changes coston l i n k cost change towards neighbor k do :
ds,k = ∞ / / l i n k f a i l u r e , cost change also poss ib leforeach d e s t i n a t i o n d do
when nexthop [ d ]= k then
Ds,d = ∞ / / a l t e r n a t i v e l y : f resh route computat iont r ansm i t towards each m ∈ Ns the l i s t o f c u r r e n t l y \
known d e s t i n a t i o n s and t h e i r most recent l e a s t costs
/ / a l i n k to a neighbor comes upon l i n k c rea t i on towards neighbor k do :
update ds,k
t r ansm i t towards each m ∈ Ns the l i s t o f c u r r e n t l y \known d e s t i n a t i o n s and t h e i r most recent l e a s t costs
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
DV Protocol Details (5)
• How to detect a link failure?
• First option: check for sustained lack of periodic DV
messages• Second option: send separate hello messages frequently,
check for lack of answers
• How to detect a cost change for a link?
• Depends on the precise link metric• Example: delays depend on lengths of output queues
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Comments
• The distances to destinations d as seen from source s
evolve over time, they change with message reception and
link failures or link establishments
• The period for periodic distance vector transmissions has
influence on convergence time
• A delay between detecting a link failure and transmitting an
updated distance vector can have significant influence on
protocol operation
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Protocol Operation
Problems
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Convergence Time
• Consider the above example network
• Assume that all nodes are switched on at the same time t = 0
• Immediately after being switched on, each node informs its neighbors about itspresence
• Each node transmits its distance vector message every 60 seconds
• After receiving the distance vector messages the shortest path computationstakes one second
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Convergence Time – Example Timeline
Time t = 0 s: all nodes are activated and send their initial DV messageTime t = 1 s: nodes finished their computations, result:
Nd 1
Dst Cost Outg
1 0 –2 1 1-2
Nd 2
Dst Cost Outg
1 1 2-12 0 –3 2 2-3
Nd 3
Dst Cost Outg
2 2 3-23 0 –6 1 3-6
Nd 6
Dst Cost Outg
3 1 6-36 0 –
Time t = 60 s: all nodes broadcast their DV messagesTime t = 61 s: nodes finished their computations, result:
Nd 1
Dst Cost Outg
1 0 –2 1 1-23 3 1-2
Nd 2
Dst Cost Outg
1 1 2-12 0 –3 2 2-36 3 2-3
Nd 3
Dst Cost Outg
1 3 3-22 2 3-23 0 –6 1 3-6
Nd 6
Dst Cost Outg
2 3 6-33 1 6-36 0 –
Time t = 120 s: all nodes broadcast their DV messagesTime t = 121 s: nodes finished their computations, result:
Nd 1
Dst Cost Outg
1 0 –2 1 1-23 3 1-26 4 1-2
Nd 2
Dst Cost Outg
1 1 2-12 0 –3 2 2-36 3 2-3
Nd 3
Dst Cost Outg
1 3 3-22 2 3-23 0 –6 1 3-6
Nd 6
Dst Cost Outg
1 4 6-32 3 6-33 1 6-36 0 –
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Convergence Time – Summary
• In this example it took 121 s to let node 1 learn the full
network!!
• If we take any DV transmission operation as the beginning
of a round, it took three rounds to converge
• If the network diameter is K hops, it would take K rounds
to converge
• Cure:
• You cannot avoid to have K rounds• You can shorten a round by shortening transmission period• Problem: more DV messages, more overhead
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Routing Loops – Example
• Suppose at time t0 routing has
converged, all nodes have
correct routing tables
• At time t1 link 3-6 fails
• At time t2 node 3 updates its
routing table entry D3,6 = ∞
• At time t3 node 2 sends a DV
message to node 3, including
D2,6 = 3
• At time t4 both nodes 2 and 3
perform a routing computation
for all known destinations and
update their routing tables
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Routing Loops – Example (2)
Time t0: routing tables after convergence (only routes to node 6):Node 2
Dst Cost Outg
6 3 2-3
Node 3
Dst Cost Outg
6 1 3-6
Time t2: routing tables after node 3 recognized link failure to node 6:Node 2
Dst Cost Outg
6 3 2-3
Node 3
Dst Cost Outg
6 ∞ 3-6
Time t3: node 3 receives the following DV message from node 2
Time t4: routing tables after both node 2 and 3 performed routing computation:Node 2
Dst Cost Outg
6 3 2-3
Node 3
Dst Cost Outg
6 5 3-2
And here we have a loop!!
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Routing Loops – Summary
• Routing loops can occur in DV protocols e.g. after link
failure or major increase in a link metric
• In this example, the loop would not have occured if node 3
would have updated its table and transmitted an updated
vector immediately after t1 and before time t3
• However, in a distributed environment such race conditions
cannot be entirely removed
• A more rigorous solution (called Diffusing UpdateAlgorithm) has been incorporated into the EIGRP protocol(see [6, Chap. 3], [3])
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Routing Loops – Time-To-Live Approach
• In networks where routing loops can occur, packets must
somehow be prevented from circulating forever
• A simple mechanism: time-to-live fields• A packet source adds to its packets a specific header field,
e.g. called time-to-live (TTL)• The TTL parameter either indicates a physical time that the
packet is allowed to circulate in the network, or it indicates
the maximum number of hops that a packet may take• Here we assume that TTL indicates max number of hops• A router behaves as follows:
• It reads the TTL field off from an incoming packet• If the TTL field is one and the router cannot directly reach
the final destination, the packet is dropped• Otherwise, the TTL field is decremented, written back into
the packet (with additional checksum re-calculation, if
necessary) and the packet is forwarded further
• This approach has been adopted by the IP protocol
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Count-to-Infinity – Example
(see [5, Sec. 4.5])
• Time t0: network has converged
• Time t1: cost on link A-B increasesfrom 4 to 100, node B detects this
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Count-to-Infinity – Example (2)
Time t0: routing tables after convergence:Node A
Dst Cost Outg
A 0 –B 4 A-BC 5 A-B
Node B
Dst Cost Outg
A 4 B-AB 0 –C 1 B-C
Node C
Dst Cost Outg
A 5 C-BB 1 C-BC 0 –
Time t1: node B detects link cost change, and computes new path to A (taking intoaccount his knowledge that C can offer a path of length 5 to A), giving:
Node A
Dst Cost Outg
A 0 –B 4 A-BC 5 A-B
Node B
Dst Cost Outg
A 6 B-CB 0 –C 1 B-C
Node C
Dst Cost Outg
A 5 C-BB 1 C-BC 0 –
We have a routing loop now!!
Time t2: node B informs node C via DV message that its new costs to A is 6, node Cre-calculates costs and route to A (which is via B), as:
Node A
Dst Cost Outg
A 0 –B 4 A-BC 5 A-B
Node B
Dst Cost Outg
A 6 B-CB 0 –C 1 B-C
Node C
Dst Cost Outg
A 7 C-BB 1 C-BC 0 –
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Count-to-Infinity – Example (3)
• Continuation:
• Node C informs node B about its new cost (which is now 7)
and subsequently node B re-calculates its cost to 8• Node B informs node C about its new cost (which is now 8)
and subsequently node C re-calculates its cost to 9• and so on, and so on• The procedure stops when node B announces costs of 50,
then leading C to adopt the direct link C-A to C
• This behaviour is known as the count-to-infinity problem
• One cure:
• Split-horizon approach: when transmitting a DV message
on a link, include updates only for nodes for which the link
is not the next-hop link!• Convince yourself that this solves the present example• But: it does not solve the problem in general!
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Another Problem with DV Protocols
• Suppose you are an evil or incompetent person and have
root access to a router running a DV protocol
• Can you imagine a way in which, by sending well-formed
DV messages, you can corrupt routing in parts of the
network?
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Link-State Protocols
Protocol Operation
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
The Dijkstra Algorithm
/ / Computes f o r a f i x e d node s the d is tances and the r o u t i n g/ / t r ee to a l l o ther nodes . Graph i s assumed to be d i r ec ted
/ / i n i t i a l i z a t i o nS′ = V \ sDs,s = 0 ; pred [ s ] = s
f o r a l l d ∈ S′ doDs,d = ds,d ; pred [ d ] = NULL ;
when ds,d < ∞pred [ d ] = s
/ / main loopwhile S′ 6= ∅ do
k =m∈S′ Ds,m
S′ = S′ \ kfor j ∈ Nk do
when Ds,k + dk,j < Ds,j
Ds,j = Ds,k + dk,j
pred [ j ] = k
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Basic Idea
• The Dijkstra algorithm needs the di,j as its main input
• Stated differently – the Dijkstra algorithm must know:
• the links (i.e. their start and end node)• and their costs / their state (up, down)
which is equivalent to knowing the whole topology
• In a distributed environment, this is not known a priori to a
node, but has to be discovered by use of a protocol
• Since such a protocol exchanges link information or link
states, they are known as link-state protocols
• Individual nodes then maintain a link-state database,
collecting all the di,j values
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Some Assumptions
• Dissemination of link states is based on flooding, which isassumed to be reliable
• Means: each node in the network eventually gets the
information• But no guarantees are given as to when this happens• (Efficient) Implementation of reliable flooding is challenging
• Upon receiving new link-state information, a node performs
the shortest-path computation (e.g. using Dijkstra) locally,
based on its current link-state database
• A node has a mechanism to detect the costs and cost
changes of its outgoing links
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Link State Advertisement (LSA) Messages
• SrcNode identifies the source of a link (its one end)
• DstNode identifies the destination of a link (its other end)
• Alternatively, we give a LinkID of the kind 1 7→ 2 to specify link
• Cost identifies the current link cost di,j
• Seqno is a sequence number
• TTL indicates the remaining time the LSA is valid (different meaning as in TTLmechanism discussed before)
• LSA messages are generated by each node for each of its outgoing links, theseare flooded reliably
• An example:
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
LSA Generation and Database Maintenance
• A node generates and floods LSA messages both:• Periodically, and• Upon topology / cost changes (triggered update)
• Periodic updates:• Period should be ≤ than the initial value of TTL field• A node receiving an LSA stores received data in link-state
database, recomputes routes and initializes a timer with the
value of the TTL field for this link• When this timer reaches 0:
• the link-state information is purged from the database• routes are re-computed without the purged link• neighbors are informed (flooding!) with special LSA with TTL
set to 0, forcing them to purge link-state information as well
• The chosen period has significant impact on overhead!!
• Updates upon topology / cost changes:• Whenever a node detects a change in cost / a link failure / a
new link, it immediately floods an LSA
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
The Need for Sequence Numbers
(see [6, Fig. 3.10])
• Suppose that LSA’s consist only ofSrcNode, DstNode, Cost
• Time t0: node 1 generates LSA[1, 1 7→ 2, 1] and sends this to nodes2 and 4
• Time t1: link 1 7→ 2 fails, node 1generates new LSA [1, 1 7→ 2,∞]and sends it to node 4
• Time t2: node 2 forwards LSA[1, 1 7→ 2, 1] to node 4 (as part of theflooding process)
ProblemHow can node 4 tell which LSA is correct?
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
The Need for Sequence Numbers (2)
• To circumvent this problem, sequence numbers are used
• More precisely:
• A node i maintains for each outgoing link o a separate
sequence number so
• Whenever i notices that the cost of link o has changed, it
sends a new LSA, includes the current value of so in it and
increments so afterwards (for periodic updates so does not
necessarily need to be updated)• Any other node k receiving a LSA for a link i 7→ j stores the
received sequence numbers• When node k receives a LSA from i for i 7→ j , it checks
whether the contained seqno is larger than the stored one
• If so, the new cost is extracted from the LSA and stored• Otherwise, the LSA is dropped
• Note: there is no coupling between sequence numbers at
different nodes (not even when sharing the same link)
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
The Sequence Number Space should be LARGE!!
• A SeqNo field in a frame is of finite width, say b bits
• Sequence number space is S = 0, 1, 2, . . . , 2b − 1
• At the end of S the numbers wrap around
• For b = 3 we have S = 0, 1, 2, . . . , 7
• Suppose a node receives two LSAs for a link, the first with
SeqNo=7, the other with SeqNo=2• Not clear whether SeqNo=2 was generated before or after
SeqNo=7!!
• To (almost) resolve this ambiguity:
• Sequence number space should be large, e.g. b = 32 or
b = 64, essentially removing need for wraparound• The TTL mechanism purges old link-state information
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Sequence Numbers and Node Crashes
• Nodes increment seqno after each LSA transmission
• Nodes can crash
• How should a crashed node choose an initial sequence
number that is “larger” than what is present in the network?
• First approach:• Initialize sequence number to 0• Wait for a time of at least maximum TTL to ensure that all
old information has been purged• Then send a LSA with sequence number 0
• Second approach (Resynchronization):• Ask neighbor for his most recent copy of own LSA message• Extract seqno from this and increment it• Send an updated LSA message with new seqno• A recovered / new node also asks the neighbor for a copy
of its link-state database to be able to compute routes
quickly (i.e. much quicker than maximum TTL parameter)
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
The Hello Protocol
• One mechanism for checking state of link are periodicpacket exchanges with neighbor
• Hello packets• Link / neighbor is considered dead after subsequent failed
hello exchanges
• Period can be significantly smaller than maximum TTL
• The initial query of a neighbors link-state database is also
considered as part of the hello protocol
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Discussion / Comments
• Each node performs route computations independently
• Because of finite propagation speed of link state changes,inconsistent views and routing loops can occur as well
• But: the flooding adopted by LS tends to resolve
inconsistencies much faster than in DV protocols
• LS protocol requires periodic flooding of LSA messages,one for each link
• Significant overhead• Reduce overhead by making period large, so that triggered
updates have major share of all updates
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Discussion of DV and LS Protocols
Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Differences between DV and LS Protocols
• Information maintained by nodes:
• DV: nodes know all other nodes and costs to reach them• LS: nodes know all links and their costs
• Protocol information messages:
• DV: carry per-node information• LS: carry per-link information
• Communication partners:
• DV: nodes talk only to their neighbors• LS: nodes inform the whole network
• Therefore:
• LS has much more overhead than DV!!• LS can propagate new information much quicker, shortens
the time for which inconsistencies can exist!
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
DV and LS Protocols – Scalability
• Both protocols have scalability issues:
• Nodes have to know all nodes / links in a network• This does not scale well to large networks like the Internet!
• Therefore, realistic protocols like OSPF are hierarchical:
• Network is partitioned into areas• A router in one area needs to know:
• How to reach each node in its own area• How to reach other areas (but not individual nodes in them!)
• Flooding of link states is restricted to own area• The hierarchy can have more levels
• Furthermore: routing is not done for the entire Internet,but only within smaller pieces (autonomous systems)
• Internet is partitioned into autonomous system (AS)• One AS is usually owned by one entity, which decides
about routing within the AS• Routing across different AS handled by BGP
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
DV and LS Protocols – Reliable Information Exchange
• We have seen that both protocols allow for periods withinconsistent views on the network
• One consequence: routing loops!
• Allowing loss of distance vector messages or LSA
messages would exacerbate consistency problems
• Therefore, many practical DV / LS protocols assume or
define a mechanism for reliable delivery of protocol control
messages (including DV messages and LSA messages)
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Outline
Introduction
Shortest-Path Algorithms
Distance-Vector Protocols
Link-State Protocols
Discussion and Further Topics
Discussion of DV and LS Protocols
Further Topics
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
k Shortest-Path Algorithms
• It is sometimes useful to have not only a single (the best!)connection between source and destination, but several,for example k paths
• One usage: backup paths for fault tolerance• Another usage: load balancing over paths
• You typically do not want some k paths, but the k best ones
• One heuristic approach for finding link-disjoint paths:
• Start w/ full network G0, identify best path P1 (e.g. Dijkstra)• Compute network G1 by removing links of P1 from G0
• Identify best path P2 in G1, and so on . . .
• Variations:
• Remove one link of P1 at a time from G0
• Remove all intermediate nodes of P1 (and their direct links)
from G0, this creates node-disjoint paths
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Max-Flow Problems
• Given a source node S and a destination node T , link labels denote capacity
• S wishes to transmit a continuous flow of constant rate to T
• Assume that source can use all links it wishes
• Assume that flows on a link can be split arbitrarily, e.g. a router can split a flow ofrate x to two outputs with rate x/2 each
• What is the maximum rate at which S can transmit data?
• Read about the Ford-Fulkerson algorithm, implement it and use it to solve thisproblem!!
Introduction Shortest-Path Algorithms Distance-Vector Protocols Link-State Protocols Discussion and Further Topics Bibliograph
Dimitri P. Bertsekas.Dynamic Programming and Optimal Control – Volume 1.Athena Scientific, Belmont, Massachusetts, 3rd edition, 2005.
Dimitri P. Bertsekas.Dynamic Programming and Optimal Control – Volume 2.Athena Scientific, Belmont, Massachusetts, 3rd edition, 2007.
J. J. Garcia-Luna-Aceves.Loop-free routing using diffusing computation.IEEE/ACM Transactions on Networking, 1(1):130–141, February 1993.
Bernhard Korte and Jens Vygen.Combinatorial Optimization – Theory and Algorithms.Springer, Berlin, third edition, 1005.
James F. Kurose and Keith W. Ross.Computer Networking – A Top-Down Approach Featuring the Internet.Addison-Wesley, Boston, fourth edition, 2001.
Deepankar Medhi and Karthikeyan Ramasamy.Network Routing – Algorithms, Protocols, and Architectures.Morgan Kaufmann, San Francicso, California, 2007.
William Stallings.Data and Computer Communications.Prentice Hall, Englewood Cliffs, New Jersey, fourth edition, 2006.
The Internet IPv4 IP Helper Protocols Bibliography
Data Communications and Networking
COSC 264IP and Related Protocols
Dr. Andreas Willig1
Dr. Muhammad Asad Arfeen2
1Dept. of Computer Science and Software EngineeringUniversity of Canterbury, Christchurch
2Dept. of Computer and Information Systems EngineeringNED University of Engineering & Technology, Karachi
UoC, 2014
The Internet IPv4 IP Helper Protocols Bibliography
Outline
The Internet
IPv4
Packet Format
IP Addressing
IP Forwarding and Routing
Fragmentation and Reassembly
IP Helper Protocols
ARP
ICMP
DNS
The Internet IPv4 IP Helper Protocols Bibliography
About This Module
• Goals of this Module:
• Get a first idea of the Internet• Get to know the IP protocol and important support protocols
• Useful references:
• The “bible” on TCP/IP: [12] (old, but still great!)• Other references: [4], [11, Part V]• Internet protocols are published as requests-for-comment
(RFC) by the Internet Engineering Task Force (IETF), you
The Internet IPv4 IP Helper Protocols Bibliography
The Hourglass Model for the Internet Protocol Stack
• “Everything over IP, IP over everything”
The Internet IPv4 IP Helper Protocols Bibliography
Outline
The Internet
IPv4
IP Helper Protocols
The Internet IPv4 IP Helper Protocols Bibliography
Introduction
• IP is specified in RFC 791 and many followup RFCs
• It is the network layer protocol of the Internet
• Some terminology:
• IP packets are called datagrams• End stations are called hosts• IP routers are called routers
• IP addresses are assigned to network interfaces:
• When a host has three Ethernet adapters, it has three IP
addresses, one for each adapter• Since most hosts have only one adapter, we speak of the IP
address of that host
The Internet IPv4 IP Helper Protocols Bibliography
IP Service – Best Effort
• Basic IP service is datagram delivery
• This service is:
• Connectionless: no connection or shared state is set up
before datagram delivery starts• Unacknowledged: IP does not use acknowledgements• Unreliable: on IP level no retransmissions are carried out• Unordered: IP does not guarantee in-sequence delivery [2]
• This kind of guarantee-nothing service is called best effort
The Internet IPv4 IP Helper Protocols Bibliography
Outline
The Internet
IPv4
Packet Format
IP Addressing
IP Forwarding and Routing
Fragmentation and Reassembly
IP Helper Protocols
The Internet IPv4 IP Helper Protocols Bibliography
Packet Format
The Internet IPv4 IP Helper Protocols Bibliography
Packet Format (2)
• Where applicable (e.g. addresses), header is using big
endian byte ordering (also called network byte order)
• The HdrLen field:
• specifies the length of IP header as number of 32-bit words• If the Options field does not use a multiple of 32 bits, a
Padding field is used to fill up to 32 bits• When HdrLen > 5, then an Options field is present
• The TOS/DSCP field:
• TOS = Type Of Service, DSCP = DiffServ Code Point• Allows to mark packets for differentiated treatment to
achieve Quality-Of-Service (QoS), e.g. express priorities• DiffServ [6] is a framework for Internet QoS, another one is
IntServ [13]• Most routers ignore the TOS/DSCP field
The Internet IPv4 IP Helper Protocols Bibliography
Packet Format (3)
• The TotalLength field:
• Gives the total length of datagram in bytes (i.e. up to 65535)• Can be modified during fragmentation and reassembly• The TotalLength field is part of IP header, since some
technologies (Ethernet!) pad up frames to achieve
minimum frame size and do not reverse this
• The Identification field:
• Uniquely identifies each datagram sent by host / interface• Incremented by source host before sending new datagram• Routers do not touch this field
• The Flags field:
• Contains two flags relevant for fragmentation and
reassembly (DF, Don’t Fragment, and MF, More Fragments)
The Internet IPv4 IP Helper Protocols Bibliography
Packet Format (4)
• The FragmentOffset field:
• is used for fragmentation and reassembly• gives the offset of the current fragment within entire
datagram, in multiples of eight bytes
• The HeaderChecksum field:
• Is calculated over IP header only, not the data (TCP, UDP
etc. have their own checksums to cover their data)
• The Time-To-Live field:
• gives upper limit to number of routers a packet can traverse• decremented by each router, forces re-computation of
header checksum• when TTL reaches one and packet cannot be directly
delivered to destination, datagram is discarded and sender
is notified with ICMP message• Typical initial values: 32 or 64
The Internet IPv4 IP Helper Protocols Bibliography
Packet Format (5)
Protocol field Protocol
0x01 ICMP
0x02 IGMP
0x04 IP-in-IP Encapsulation
0x06 TCP
0x11 UDP
• The Protocol field indicates thehigher-layer protocol that generatedthe payload
• This field provides protocolmultiplexing
• Some values shown in table
The Internet IPv4 IP Helper Protocols Bibliography
Packet Format (6)
• The SourceAddress/DestinationAddress fields:
• SrcAddr indicates the initial sender of datagram• DstAddr indicates intended final receiver of datagram• Are of 32 bits width
• The Options field:
• Contains header field for optional IP features• One example option: source routing• Options are rarely used, we will not consider this anymore
The Internet IPv4 IP Helper Protocols Bibliography
Outline
The Internet
IPv4
Packet Format
IP Addressing
IP Forwarding and Routing
Fragmentation and Reassembly
IP Helper Protocols
The Internet IPv4 IP Helper Protocols Bibliography
IP Address Representation
• IP addresses have a width of 32 bits
• They are supposed to be worldwide unique
• This is not really true anymore with NAT . . .
• IP addresses are written in dotted-decimal notation, e.g.:
130.149.49.77
where decimal (!) numbers are separated by dots
• They have an internal structure:
<network-id> <host-id>
where:
• <network-id> denotes a network (e.g. an Ethernet)• <host-id> refers to a host within this network
• The <host-id> must only be unique w.r.t. its network
The Internet IPv4 IP Helper Protocols Bibliography
Important Points
Important Point
A host address is tied to its location in the network, i.e. it is
coupled to network topology. When a host switches to another
network, it obtains another address and ongoing connections
(TCP!) are disrupted – IP therefore has no direct support for
mobility!!
Important Point
IP Routing is mostly concerned with networks, i.e. forwarding
tables in routers mostly store <network-id>’s – it is the
responsibility of the last router on a path to deliver an IP
datagram to a directly connected host.
The Internet IPv4 IP Helper Protocols Bibliography
Classful Addressing
• Initially so-called classful addressing has been used
• IP-addresses are subdivided into four classes:
• Class-A addresses: 7 bit network-id, 24 bits host-id, i.e. 128
class-A networks with maximum 224− 2 ≈ 16.7 million
hosts in each network
• Class-B addresses: 14 bit network-id, 16 bit host-id
• Class-C addresses: 21 bit network-id, 8 bit host-id
• Class-D addresses: 28 bits multicast group address
The Internet IPv4 IP Helper Protocols Bibliography
Classful Addressing (2)
• For each network-id there are two special host-ids:
• Host-id with all zeros refers to the network as such• Host-id with all ones is the broadcast address of this
network
• Example:
• 130.149.0.0 refers to a class-B network• 130.149.255.255 is broadcast address of this network• 130.149.49.123 refers to a particular host in that network
The Internet IPv4 IP Helper Protocols Bibliography
Classful Addressing – Discussion
• These three classes support networks of few distinct sizes
• Problems:
• With the growth of the Internet class-B addresses were
quickly exhausted, but many of the requesting
organizations do not really have 65534 hosts, these often
were poorly utilized• With the allocation of class-C addresses the routing tables
in Internet core routers quickly became large, which slows
down packet processing!
The Internet IPv4 IP Helper Protocols Bibliography
Subnetting
• Suppose that an organization:
• has a class-B network address, say 130.149.0.0• has its network internally divided into several LANs,• and wants to couple these by routers
• First option: allocate a class C address for each LAN
• requires additional addresses• increases size of routing tables in core routers
• Second option: use class-B address externally, subdividethis network internally
• The whole class-B network is seen by all external networks
only through one border router and one IP address• All internal networks are allocated addresses like
130.149.x.0 with an eight-bit host part• All internal routers and the border router know the internal
network structure and the networks
The Internet IPv4 IP Helper Protocols Bibliography
Classless Inter-Domain Routing
• CIDR = Classless Inter-Domain Routing
• Introduced 1993, specified in RFCs 1518, 1519, 4632
• Goal was to address the problems of classful addressing
by giving more fine-grained network sizes
• CIDR runs in conjunction with more modern routing
protocols like OSPF, RIP-2 or BGP
• In CIDR a network is specified by two values:
• A 32 bit network address• A 32 bit network mask (netmask)
The Internet IPv4 IP Helper Protocols Bibliography
CIDR – Netmask
• For a given 32-bit IP address the netmask specifies which
bits belong to the network-id and which bits belong to the
host-id
• The netmask consists of 32 bits, the left k bits are ones,
the remaining bits are zeros
• Examples:
Netmask Shorthand
11111111.11110000.00000000.00000000 /12
11111111.11111111.00000000.00000000 /16
11111111.11111111.11100000.00000000 /19
11111111.11111111.11111110.00000000 /23
The Internet IPv4 IP Helper Protocols Bibliography
CIDR – Netmask (2)
• Example: we are given the host address 192.168.40.3
and the netmask /24, then the hosts network address can
be computed as:
11000000.10101000.00101000.00000011 192.168.40.3
AND 11111111.11111111.11111111.00000000 /24
11000000.10101000.00101000.00000000 192.168.40.0
• The same example, now with netmask /21:
11000000.10101000.00101000.00000011 192.168.40.3
AND 11111111.11111111.11111000.00000000 /21
11000000.10101000.00101000.00000000 192.168.40.0
• In both examples the network addresses are the same, but
the networks are of different size
• To fully specify a network, one gives both network address
and netmask, e.g.:
192.168.40.0/21
The Internet IPv4 IP Helper Protocols Bibliography
CIDR – Netmask (3)
• In the network 192.168.40.64/28 there are 14addresses available:
• The netmask leaves four bits for the host-id, i.e. 16 values• The value 0000 is part of the network-id• The value 1111 is the broadcast address for this network
The Internet IPv4 IP Helper Protocols Bibliography
Supernetting
• Suppose an organization has allocated 16 networks of size/24 with contiguous network addresses, e.g.:
• 130.149.64.0/24
• 130.149.65.0/24
• . . .• 130.149.79.0/24
• With supernetting:
• these networks are summarized under the network address
130.149.64.0/20
• Routers outside any of these networks only have an entry
for 130.149.64.0/20 instead of 16 entries
• Can you figure out the formal conditions under which
supernetting is allowed?
The Internet IPv4 IP Helper Protocols Bibliography
Reserved IP address blocks
Address Block Current Usage
10.0.0.0/8 Private-use IP networks127.0.0.0/8 Host loopback network169.254.0.0/16 Link-local for point-to-point links (e.g. dialup)172.16.0.0/12 Private-use IP networks192.168.0.0/16 Private-use IP networks
(from: [8])
• Private-use IP addresses are often used for broadband
clients or by NAT boxes
• The “traditional” loopback address of a host is
127.0.0.1, but any address from the 127.0.0.0/8
network serves the same purpose
• Packets with private addresses are not routed in the public
internet, only within the provider network
The Internet IPv4 IP Helper Protocols Bibliography
Outline
The Internet
IPv4
Packet Format
IP Addressing
IP Forwarding and Routing
Fragmentation and Reassembly
IP Helper Protocols
The Internet IPv4 IP Helper Protocols Bibliography
Simplified Packet Processing
The Internet IPv4 IP Helper Protocols Bibliography
Simplified Packet Processing (2)
• Packet processing chain is followed in routers and hosts• Incoming packets are checked for correctness and stored
in IP input queue – correctness includes:• right value in IP version field• correct IP header checksum
• Next, packet options are processed:• Options are rarely used• Special case: source routing option, then packet is
delivered to IP output stage
• Next, it is checked if packet is destined to this host / router
or to broadcast address• If so, protocol demultiplexing is carried out
• The protocol field in IP header is checked for its value• Packet payload is delivered to the software entity
implementing the indicated higher-layer protocol• Packet is not processed any further!
The Internet IPv4 IP Helper Protocols Bibliography
Simplified Packet Processing (3)
• If the packet is not destined to this host/router:• If packet forwarding is not enabled, the packet is dropped• Otherwise:
• Check if packet is destined to a directly reachable station
(e.g. on same Ethernet) – if so, deliver packet directly• If packet is not destined to directly reachable station, consult
forwarding table to determine next hop / outgoing interface• Decrement TTL value, drop packet when it reaches zero• Recompute packet header checksum (why?)• Hand packet over to outgoing interface
• Forwarding table is maintained by a routing daemon, i.e.
a process executing a routing protocol
• Note that datagrams to be routed can come from local
applications or from other hosts via IP input queue• Linux commands to inspect / modify forwarding table:
• netstat
• route
The Internet IPv4 IP Helper Protocols Bibliography
Forwarding Table Contents
• Each entry in the forwarding table contains:• Destination IP address, which can be either:
• a full host address (i.e. non-zero host-id)• a network address, with netmask
depending on the value of a flag• Information about next hop, either:
• IP address of next-hop router (must be directly reachable)• IP address of directly-connected network (network address)
• Flags:
• A flag telling whether destination IP is host or network• A flag telling whether next hop is a router or directly attached
network
• Specification of outgoing interface
The Internet IPv4 IP Helper Protocols Bibliography
Forwarding
• From forwarding table structure it is clear that a host /
router does not know the full path, but only next hop
• Forwarding table lookup for a packet with destination IPaddress dst proceeds in three stages:
• First look for an entry that is a full-host address matchingdst – if found, send packet to indicated next hop / outgoinginterface and stop processing
• This is not used very often
• Next look for an entry that is a network address matching
dst – if found, send packet to indicated next hop / outgoing
interface and stop processing• Finally look for special default entry – if found, send packet
to indicated next hop (the default router) and stop
processing• Otherwise drop packet, send ICMP message back to
original sender of datagram
The Internet IPv4 IP Helper Protocols Bibliography
Forwarding Tables in Hosts
• Most end hosts leverage the default route mechanism:• An end host can differentiate between packets to local
destinations and to all other destinations
• Question: suppose an end host has address
130.149.49.77 and is part of a /24 network – how does it
check whether a destination address dst belongs to another
host in the same network?
• Packets to local destinations are delivered directly• Packets to all other destinations are sent to default router
• Therefore, forwarding tables in end hosts can be made outof just two entries:
• One entry for the local network• The default route
• The default route must be configured
The Internet IPv4 IP Helper Protocols Bibliography
Forwarding Tables in Routers
• Most routers at the “border” of the Internet only have
routing tables for a subset of all networks attached to the
Internet, for all other networks they rely on default routers
• Some routers in the core:
• do not have a default router• are the default routers of other routers• must know (almost) all the Internet networks
The Internet IPv4 IP Helper Protocols Bibliography
Routing – Interior and Exterior Gateway Protocols
• Applying any distance-vector or link-state routing protocolto the whole Internet is hardly feasible
• Routing tables in routers would become too large• Internet dynamics would keep routing protocols busy all the
time (triggered updates)
• The Internet therefore is subdivided into autonomoussystems (AS):
• An AS is administered by one authority• An AS has a unique 16-bit identifier• Examples: a University campus, a corporation
• Routing protocols that route . . .
• within an AS are called interior gateway protocols• across AS are called exterior gateway protocols
The Internet IPv4 IP Helper Protocols Bibliography
Routing – Interior Gateway Protocols
• An AS can choose any of the interior gateway protocols to
determine routes between routers in the same AS
• Some interior gateway protocols:• RIP and RIP-2 (Routing Information Protocol):
• Defined in RFCs 1058 and RFC 1388• Both are distance-vector protocols, metric is hop-count• RIP-2 contains improvements to address DV problems
• Higher-layer protocols (TCP, UDP) and applications shouldnot be required to know these maximal sizes:
• One reason: “software hygiene”, separation of concerns• Another reason: it is not well defined:
• Different packets of the same flow can take different routes• A packet can use different technologies while on travel• Even if all packets go the same route, this route can change
due to link failures / restores
The Internet IPv4 IP Helper Protocols Bibliography
Fragmentation and Reassembly
• IP hides this from upper layers, offers own maximummessage length of 65515 bytes to higher layers
• 65515 = 65535 - 20, 20 bytes is minimum size of IP header
• To cope with smaller MTUs:
• Sender IP instance partitions message into fragments• Fragment size is chosen as MTU of outgoing link• Each fragment is transmitted individually as a full IP packet,
with header information specifying that this is a fragment
and giving the position of fragment in whole message• IP instance at destination buffers received fragments,
re-assembles message and delivers to higher layers
QuestionWould it be useful to have intermediate IP routers perform
reassembly?
The Internet IPv4 IP Helper Protocols Bibliography
Fragmentation and Reassembly (2)
• In addition, every intermediate router can:
• fragment a full message• further fragment a fragment
when necessary for transmission on next hop
• When the destination receives the first fragment, it:
• Allocates buffer large enough for whole message• Starts a timer
• When all fragments arrive before timer expiration:
• Timer is canceled• Re-assembled packet is handed over to higher layers• Buffer is de-allocated
• When timer expires before all fragments have arrived:
• The already received fragments are dropped, buffer is freed• ICMP message (type 11, code 1) is sent to source host
The Internet IPv4 IP Helper Protocols Bibliography
Some Details
• Every message handed over to IP from higher layers hasits own identifier
• See identification field in IP header
• All fragment datagrams belonging to same message have:
• A full IP header• The same identification field• A TotalLength field reflecting the fragment size• Different values for FragmentOffset field (reflecting the
start of the present fragment within the whole message):
• FragmentOffset specifies offset in multiples of 64 bits
• The MF (more-fragments) bit set, except for the last
fragment, which has non-zero FragmentOffset
The Internet IPv4 IP Helper Protocols Bibliography
Some Details: The DF bit
• By setting the DF (don’t fragment) bit in the IP header a
source node forbids fragmentation by intermediate routers
• When a router receives a datagram with DF set, it:
• Checks whether outgoing link for this packet has an MTU
large enough to transmit the packet• If so, the packet is transmitted onto next hop• If not, the router drops the datagram and returns an ICMP
datagram to original IP source
• ICMP with type 2 (“destination unreachable”) and code 4
(“fragmentation required, but DF set”)
The Internet IPv4 IP Helper Protocols Bibliography
Some Details: The DF bit (2)
QuestionHow could you use this for the sender to determine the path
MTU, defined as the smallest MTU of all links along a path
between source and destination?
The Internet IPv4 IP Helper Protocols Bibliography
• Several datagrams transmitted per message, each one
having full IP header• Reassembly adds significant complexity to receiver• Upon loss of single fragment the whole message is possibly
re-transmitted by higher layers (TCP!)
• Fragmentation and reassembly complicates operation ofapplication-level firewalls, since these also must implementreassembly logic
• Application-level firewalls look at user data of packets• When user data is spread over several fragments, it must
collect them all
• Exception: the part of user data that is of interest is known to
fit in the first fragment
The Internet IPv4 IP Helper Protocols Bibliography
Outline
The Internet
IPv4
IP Helper Protocols
The Internet IPv4 IP Helper Protocols Bibliography
Outline
The Internet
IPv4
IP Helper Protocols
ARP
ICMP
DNS
The Internet IPv4 IP Helper Protocols Bibliography
Address Resolution Protocol – ARP
• IP addresses only have a meaning to IP and higher layers
• In an Ethernet, stations have own 48-bit MAC addresses
• An Ethernet station picks up a packet only if the destination
MAC address matches its own MAC address (ignoring
broadcast/multicast), IP addresses and other packet
contents are ignored
• An IP address is assigned to an Ethernet adapter
Important Question
How do other stations know to which MAC address a given IP
address refers, i.e. to which station an IP packet must be sent
(encapsulated in Ethernet packet)?
The Internet IPv4 IP Helper Protocols Bibliography
Address Resolution Protocol – ARP (2)
• ARP provides a binding service: it determines MAC
address for given IP address
• ARP is specified in RFC 826
• ARP is not restricted to Ethernet MACs, but in general is
geared towards LANs with broadcast capabilities
• ARP is dynamic:• The MAC address for a given IP address does not need to
be statically configured, but the protocol provides a
mechanism to determine this on-the-fly• Advantage: nodes can be moved or equipped with new
MAC adapters without any re-configuration• Disadvantage: a separate protocol is needed, bringing
additional complexity and requiring some bandwidth
• There is also a protocol that lets stations find an IP address
for given MAC address, this is called RARP (Reverse ARP)
The Internet IPv4 IP Helper Protocols Bibliography
Basic Operation of ARP
• Suppose that:
• We have two stations A and B attached to the same
Ethernet, having the following addresses:
Station A Station B
MAC 11:11:11:11:11:11 22:22:22:22:22:22
IP 130.149.49.11 130.149.49.22
• Both A and B are in the same IP network
130.149.49.00/24, which is an Ethernet network• Station A wishes to send an IP packet to address
130.149.49.22 and does not yet have any information
about the corresponding MAC address
• Each station maintains an ARP Cache, which stores the
mappings from IP to MAC addresses that the station
currently knows about
The Internet IPv4 IP Helper Protocols Bibliography
Basic Operation of ARP (2)
• Station A broadcasts an ARP-request message(displayed in wireshark as arp who-has), indicating:
• A’s own IP and MAC address• B’s IP address
Broadcasting means: packet is sent to Ethernet
broadcast address!!
• Any host C having an IP address other than
130.149.49.22 simply drops the ARP-request packet• Upon receiving the ARP request, host B (with IP address130.149.49.22) performs the following actions:
• It stores a binding between between A’s IP and MAC
address in its own ARP cache• It responds with an ARP-reply packet that includes:
• B’s MAC and IP address• A’s MAC and IP address
ARP reply is unicast to A’s MAC addr. (Why no broadcast?)
The Internet IPv4 IP Helper Protocols Bibliography
Basic Operation of ARP (3)
• Upon receiving ARP response from B, station A stores a
binding between B’s IP and MAC address in its ARP cache
• This procedure is called address resolution
• ARP does not make any retransmissions in case the ARP
request is not answered, this is left to higher layers
• If a station wants to send an IP packet to a localdestination with address xx.xx.xx.xx, it:
• first checks the ARP cache whether a binding for
xx.xx.xx.xx can be found• If so, the packet is encapsulated in an Ethernet frame and
directed to the MAC address found in the ARP cache• Otherwise, the address resolution procedure is started and
the packet is sent when the result is available
The Internet IPv4 IP Helper Protocols Bibliography
The ARP Cache
• The entries in an ARP cache are soft-state, entries aretypically removed 20 minutes after their creation
• Why?• Some implementations restart the timer after each
reference to an ARP cache entry
• Under Linux you can inspect your ARP cache with the
command:
/usr/sbin/arp -a
The path to the arp command can vary between systems
The Internet IPv4 IP Helper Protocols Bibliography
The ARP Frame Format
(See [12, Sect. 4])
• HardType determines the type of MAC addresses used, 0x0001 for Ethernet48-bit addresses
• ProtType determines the higher-layer protocol for which address resolutionneeds to be done, value 0x0800 for IP
• HardSize and ProtSize specify the size (in bytes) of the hardware and andprotocol addresses – they are 6 and 4 for Ethernet and IP
• Op distinguishes between ARP-request and ARP-reply, and some other types(RARP is covered as well)
• The remaining four fields are the mentioned address fields
The Internet IPv4 IP Helper Protocols Bibliography
Outline
The Internet
IPv4
IP Helper Protocols
ARP
ICMP
DNS
The Internet IPv4 IP Helper Protocols Bibliography
Introduction
• ICMP = Internet Control Message Protocol
• Specified in RFC 792
• This protocol:• Accompanies IP by allowing routers or destination hosts to
inform sender about “unusual” situations, including:
• There is no route to the destination• Destination host exists, but is not reachable• Fragmentation required but DF set
• Operates “on top” of IP, i.e. ICMP messages are
encapsulated in regular IP datagrams• Does not add any additional mechanisms (like error control)
to the IP service• IP sending host must not rely on ICMP messages
The Internet IPv4 IP Helper Protocols Bibliography
Message Format
• type and code specify actual ICMP message type and sub-type
• checksum covers ICMP header and data, with checksum assumed as zero
The Internet IPv4 IP Helper Protocols Bibliography
The Internet IPv4 IP Helper Protocols Bibliography
The Domain Name Service (DNS)
• Initial specifications in RFC 1034 and RFC 1035
• DNS is responsible for mapping human-readable names to
addresses, it is a binding service
• DNS is used solely by applications, it has no role in the
TCP/UDP/IP protocols themselves• It has a distributed implementation:
• It consists of several name servers, which assist end hosts
in mapping a name to an address• No name server has the full knowledge of all bindings that
exist in the Internet• Besides mapping names to IP addresses it has additional
functions:• It allows to return an email server address for a given host• It allows to manage alias names for hosts
• It is also possible to perform reverse lookup, i.e. mapping
IP addresses to names
The Internet IPv4 IP Helper Protocols Bibliography
The DNS Name Space
(compare [12, Fig. 14.1])
The Internet IPv4 IP Helper Protocols Bibliography
The DNS Name Space (2)
• The name space is hierarchical:
• Arranged as a tree made of nodes• Each node has label of up to 63 characters• The domain name of any node is the (unique) list of all
labels that connect it with the unnamed root• All immediate children of a node must have distinct names
• In the written representation a full host name is
represented by its name, followed by its domain, all labels
are separated by “.”
• Example:
www.canterbury.ac.nz
Here:
• www is the host name• canterbury.ac.nz is its domain name
The Internet IPv4 IP Helper Protocols Bibliography
DNS – Zones
• A zone is a sub-tree of the namespace that isadministered separately
• Example: ac.nz
• A zone can be sub-divided into further zones, e.g. therecould be zones:
• canterbury.ac.nz
• massey.ac.nz
• For each zone multiple nameservers must be provided by
the administrative owner of that zone
The Internet IPv4 IP Helper Protocols Bibliography
DNS – Nameservers
• A nameserver keeps a table of all name 7→ IP-addressmappings in a zone
• When new host is added, administrator allocates name and
IP address and enters them into table• When host is removed, table entry is deleted as well
• There are primary nameservers and secondarynameservers:
• These are independent and redundant servers• Reason: fault tolerance• A primary nameserver reads the mapping table from a file• A secondary nameserver reads mappings from primary
nameserver (zone transfer)• Secondary nameservers update their tables regularly
against a primary nameserver
• A nameserver can handle several zones
The Internet IPv4 IP Helper Protocols Bibliography
DNS – Client Side
• Applications in hosts are DNS clients
• A DNS resolver library is linked to an application
• Under UNIX:
• see man page for gethostbyname for a C binding to the
resolver• nslookup is a command-line version of the resolver• The resolver reads a configuration file (often found under
/etc/resolv.conf, which contains a line like
nameserver 130.149.14.12
• The resolver uses the nameserver(s) specified in
/etc/resolv.conf to perform name resolution
The Internet IPv4 IP Helper Protocols Bibliography
DNS – Query Process
• The host hands over a name to its local resolver
• Example: www.canterbury.ac.nz
• The resolver library sends a request to its nameserver
• The nameserver:
• Checks if the requested name is in its zone table• If so, it returns a response to the resolver, which includes
the name 7→ IP-address binding• Otherwise, it contacts a root name server
• Currently there are 13 known root servers• The nameserver must know IP addresses of all of them as
part of its configuration
• The root server returns name and address of a nameserverresponsible for the top-level domain of the request
• Here: nz
The Internet IPv4 IP Helper Protocols Bibliography
DNS – Query Process (2)
• Continuation:
• It next connects to the nameserver for zone nz, which
returns name and address of the nameserver for zone
ac.nz
• It next connects to the nameserver for zone ac.nz which
returns name and address of the nameserver for zone
canterbury.ac.nz
• It next connects to the nameserver for zone
canterbury.ac.nz which then returns the IP address for
host www.canterbury.ac.nz
The Internet IPv4 IP Helper Protocols Bibliography
DNS – Caching
• A nameserver is required to store a name 7→ IP-addressmapping for a time that is indicated in the response of thefinal nameserver
• Caching
• Reason: when same name needs to be resolved shorttime later, it is not necessary to again involve allnameservers, the query can be handled from cache
• Load reduction on root name servers
The Internet IPv4 IP Helper Protocols Bibliography
David Alderson, Lun Li, Walter Willinger, and John C. Doyle.Understanding Internet Topology: Principles, Models and Validation.IEEE/ACM Transactions on Networking, 13(6):1205–1218, December 2005.
Jon C. R. Bennett, Craig Partridge, and Nicholas Shectman.Packet Reordering is Not Pathological Network Behaviour.IEEE/ACM Transactions on Networking, 7(6):789–798, December 1999.
David D. Clark.The design philosophy of the darpa internet protocols.ACM Computer Communication Review, 18(4):106–114, August 1988.
Douglas E. Comer.Internetworking with TCP/IP – Principles, Protocols and Architecture, volume 1.Prentice Hall, Englewood Cliffs, New Jersey, third edition, 1995.
J. J. Garcia-Luna-Aceves.Loop-free routing using diffusing computation.IEEE/ACM Transactions on Networking, 1(1):130–141, February 1993.
Kalevi Kilkki.Differentiated Services for the Internet.Macmillan Technical Publishing, Indianapolis, 1999.
James F. Kurose and Keith W. Ross.Computer Networking – A Top-Down Approach Featuring the Internet.Addison-Wesley, Boston, third edition, 2001.
The Internet IPv4 IP Helper Protocols Bibliography
Deepankar Medhi and Karthikeyan Ramasamy.Network Routing – Algorithms, Protocols, and Architectures.Morgan Kaufmann, San Francicso, California, 2007.
J. H. Saltzer.Naming and binding of objects.In R. Bayer, R. M. Graham, and G. Seegmüller, editors, Operating System – AnAdvanced Course, Lecture Notes in Computer Science, pages 99–208. Springer,1978.
Jerome H. Saltzer, David P. Reed, and David D. Clark.End-to-end arguments in system design.ACM Transactions on Computer Systems, 2(4):277–288, November 1984.
William Stallings.Data and Computer Communications.Prentice Hall, Englewood Cliffs, New Jersey, fourth edition, 2006.
W. Richard Stevens.TCP/IP Illustrated Volume 1 - The Protocols.Addison-Wesley, Boston, Massachusetts, 1995.
Paul P. White and Jon Crowcroft.The integrated services in the internet: State of the art.Proceedings of the IEEE, 85(12):1934–1946, December 1997.