This presentation is the property of its rightful owner.
Sponsored Links
1 / 95

Network PowerPoint PPT Presentation

  • Uploaded on
  • Presentation posted in: General

Network. Layers. Principles of Computer System (2012 Fall). Review. System Complexity Modularity & Naming Enforced Modularity C/S Virtualization: C/S on one Host Virtual Memory: Paging Virtual Link: Bounded Buffer  S imilar as Network Virtual Processor: Thread Virtual Machine.

Download Presentation


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript




Principles of Computer System (2012 Fall)



  • System Complexity

  • Modularity & Naming

  • Enforced Modularity

    • C/S

    • Virtualization: C/S on one Host

      • Virtual Memory: Paging

      • Virtual Link: Bounded Buffer  Similar as Network

      • Virtual Processor: Thread

      • Virtual Machine

Network as a system

Network as a system

Network is a system too

Network is a system too

  • Network As a System

    • Network consists of many networks many links many switches

    • Internet is a case study of successful system

Network problems and approaches

Network: Problems and approaches

  • Economical

    • Universality

    • Topology, Sharing, Utilization

  • Organizational

    • Routing, Addressing, Packets, Delay

    • Best-effort contract

  • Physical

    • Errors, speed of light, wide-range of parameters

  • Design challenge: what does the network do and what do hosts do?

    • Smart network or dumb network?

    • Internet: best-effort

Network overview

Network overview

  • Basic abstraction

    • Communication link: SEND & RECEIVE

  • Interesting properties

    • Interface style

    • Interface timing

    • Latency

    • Failure modes

    • Parameter ranges

Consideration 1 of 3 physical properties

Consideration 1 of 3: Physical properties

  • Propagation delay

    • The speed of light is finite

    • Accommodate a range of delay spanning 7 orders of magnitude: the first parameter

  • Hostile environment

    • A burst noise, a careless backhoe operator, etc.

  • Limited bandwidth

    • Limited signaling, finite signal power, noise

    • The second parameter: available data rate

Consideration 2 of 3 sharing of facilities

Consideration 2 of 3: Sharing of facilities

  • Any-to-any connection

    • Number of separated paths grows with the square

    • The third parameter: number of connected entities

  • Sharing of communication costs

    • Same tech trends as processor, memory, etc.

    • Digging up streets to lay wire or fiber, satellite, etc.

    • Communication costs rarely fall as fast as tech would permit

Consideration 3 of 3 four different parameters

Consideration 3 of 3: Four different parameters

  • Four Different Parameters

    • Propagation times: latency

    • Data rates: throughput

    • Number of communicating computers: scale

    • Different network loads

      • Ranging from 30MB/s to 1 B/s

  • System that use network as a component must take them into account

Networks are heterogeneous

Networks are heterogeneous

D tech dt for networks

d(tech)/dt for networks

Sharing a connection

Sharing a connection

  • Isochronous communication

    • Needs prior arrangement between switches

    • Connection: set up and tear down

    • Stream: continuous bits flows out of a phone

  • Data communication

    • Message: burst data, ill-suited to fixed size and spacing of isochronous frames

    • Connectionless, asychronous

Isochronous multiplexing

Isochronous multiplexing

  • Telephone network

    • “network is busy”

Isochronous tdm

Isochronous - TDM

  • 64 Kbps each phone, 45 Mbps link

  • 8-bit block (frame), 8000 frames per second

  • 5625 bit times or 125 us

  • 703 simultaneous conversations

  • Why the voice is still continuous, instead of fragmented?

Data communication network

Data communication network

Frame and packet

Frame and packet

  • Asynchronous link

    • Frame can be of any length, carried at any time that the link is free

    • Packet: a variable-length frame with its guidance info

    • Connectionless transmission: no state maintained

    • Segment and reassemble

    • Packet voice: replacing many part of isochronous network

Packet routing forwarding

Packet routing/forwarding

  • Packet switching

    • Routing: choosing a particular path (control plane)

    • Forwarding: choosing an outgoing link (data plane)

      • Usually by table lookup

Delay transit time

Delay (transit time)

  • Propagation delay

    • Depends on the speed of light in the transmission medium

  • Transmission delay

    • Depends on the data rate of the link and length of the frame

    • Each time the packet is transmitted over a link

  • Processing delay

    • E.g. examine the guidance info, checksum, etc.

    • And copying to/from memory

  • Queuing delay

    • Waiting in buffer

    • Depends on the amount of other traffic

Multiplexing demultiplexing


  • Multiplex using a queue

    • Switch need memory/buffer

  • Demultiplexusing information in packet header

    • Header has destination

    • Switch has a forwarding table that contains information about which link to use to reach a destination

Queuing theory

Queuing theory

  • ρ: utilization of the outgoing line, from 0 to 1

  • Tradeoff between delay and utilization

    • Delay rises rapidly as the line utilization approaches 100%

    • Average delay vs. peak delay

  • In practice, limit the size of queues, exerting control on arrival

    • Shift delays to other places in the network



  • Network Overload

    • Permanent: by new devices

    • Medium time-scale: feedback to senders

    • Short-term: buffer packages

  • Queuing theory’s implication

    • Buffer space is needed to hold the waiting packets

    • How large a buffer should the designer allocate?

    • The average number is 1/(1-ρ)

    • The variance of queue length is also 1/(1-ρ)

    • How to handle peaks? Bursting batches?

Choosing a buffer size

Choosing a buffer size

  • Plan for the worst case

    • Allocate enough buffer to handle the worst case

  • Plan for the usual case and fight back

    • Allocate buffer that work most of the time

    • If buffer is full, send message back and ask someone to stop sending

  • Plan for the usual case and discard overflow

    • Allocate buffer that work most of the time

    • If buffer is full, ruthlessly discard packets

Choosing a buffer size1

Choosing a buffer size

  • Buffer memory is low in cost

    • Worst case may be many orders of magnitude larger than average case, and unlikely

  • Waiting in a queue vs. aborting

  • So, making the common case fast is attractive

  • But, what if congested?

Push back vs discard

Push back vs. discard

  • Push back

    • Send a message back along the incoming link

    • “Don’t send any more until you hear from me”

    • The message itself may add the congestion

    • Which source to stop? It may be no longer sending

  • Throw away

    • The source will resend

    • Not for the worst case

Overflowing buffer and discard packets

Overflowing buffer and discard packets

  • Automatic rate adaptation

    • Sender interprets the lack of ACK as congestion

    • Reduce the sending rate

  • Queuing theory is not enough

    • Simple theoretical models of network behavior based on standard queuing theory do not apply

    • Requires a much deeper understanding of the specific algorithm used not just by the network but also by network applications

Best effort network

Best-effort network

  • Best-effort network

    • If it cannot dispatch, may discard a packet

  • Guaranteed-delivery network

    • Also called store-and-forward network, no discarding data

    • Work with complete messages rather than packets

    • Uses disk for buffering to handle peaks

    • Tracks individual message to make sure none are lost

  • In real world

    • No absolute guarantee

    • Guaranteed-delivery: higher layer; best-effort: lower layer

Duplicate packets and suppression

Duplicate packets and suppression

  • Discarding packets is common case

    • Many network protocol includes timeout and resend mechanism

  • When a congested forwarder discards a packet

    • Client doesn’t receive a response as quickly as originally hoped

    • Users may prepared for duplicate requests and responses

      • Detecting duplicates may or may not be important

Duplicate packets and suppression1

Duplicate packets and suppression

Duplicate packets and suppression2

Duplicate packets and suppression

Duplicate packets and suppression3

Duplicate packets and suppression

  • Request and response number

    • Each request includes a nonce

    • Nonce: a unique ID that never be reused by A

  • B maintains a list of nonce

    • Check the list to detect duplicates

    • What if B crashes and restarts?

  • Idempotent design

    • Repeating the same request has the same effect as doing it just once

Damaged packets and broken links

Damaged packets and broken links

  • Data can be damaged

    • Noise, during transit, in memory

    • Error detection and correction are needed

      • Checksum: redundant error-detecting info (k-bit)

      • Parity check: when k=1

    • What about just discard the damaged packets?

      • Turn the new question to the old one

  • More details in Chap-8

Reordered delivery

Reordered delivery

  • More than one path from A to B

    • Different order of packets

    • Need further info to reorder

Summary the best effort contract

Summary & the best-effort contract

Summary the best effort contract1

Summary & the best-effort contract

  • 1. Networks encounter a vast range of parameters

    • Data rates

    • Propagation, transmission, queuing, and processing delays.

    • Loads

    • Numbers of users

  • 2. Networks traverse hostile environments

    • Noise damages data

    • Links stop working

  • 3. Best-effort networks have:

    • Variable delays

    • Variable transmission rates

    • Discarded packets

    • Duplicate packets

    • Maximum packet length

    • Reordered delivery

Layers in network

Layers in network

Layers in network1

Layers in network

  • Principles

    • Adopt sweeping simplifications

    • Divide-and-conquer

    • Layering of protocols

      • What is a protocol?

      • Where is a protocol implemented?

        • From a programmer’sperspective

An example fire in a video game

An example: FIRE in a video game

  • FIRE in a video game

    • FIRE (#_of_missiles, target, action_if_defended)

    • procedure FIRE (n_missiles, where, reaction)

  • Interpreted at two levels (implicit agreement)

    • The system matches the name FIRE with the procedure and transfer control to it

    • The procedure matches the arguments, position by position

Rpc version

RPC version







Three protocol layers

Three protocol layers

  • Transport protocol

    • SEND_MESSAGE (request_message, service_name)

    • Each module has not two, but three interfaces

Layered design

Layered design

  • Layer

    • Each layer hides the operation of the layer below from the layer above

    • Provides its own interpretation of all the features of the lower layer

  • A may call J, K, L

  • A can’t see X,Y,Z

Layers in network2

Layers in network

  • Link layer

    • Moving data directly from one point to another

  • Network layer

    • Forwarding data through intermediate points to move it to the place it is wanted

  • End-to-end layer

    • Everything else required to provide a comfortable application interface

  • Application

    • Can be thought of as a fourth layer

    • Not part of the network

Tcp ip architecture internet layer

TCP/IP architecture-- Internet layer

  • Each layer adds/strips off its own header

  • Each layer may split up higher-level data

  • Each layer multiplexes multiple higher layers

  • Each layer is (mostly) transparent to higher layers

Link layer

Link layer

LINK_SEND (data_buffer, link_identifier)

Link layer1

Link layer

  • Payload: the data passed from an upper layer to a lower layer

  • Header and trailer

  • Upcall: when data arrives, the lower layer makes a procedure call up in the higher layer


Network layer

Network layer

NETWORK_SEND (segment_buffer, network_identifier, destination)

End to end layer

End-to-end layer

End to end layer1

End-to-end layer

  • Provide several distinct end-to-end services

    • Presentation services: translating data formats and emulating the semantics of a procedure call

    • Transport services: dividing into segments and dealing with lost, duplicated, out-of-order

    • Session services: e.g. contains an ID to tell the service which client is making this call

  • Lower layer will not look inside the payload

    • How to enforce this policy?

End to end argument

End-to-end argument

  • 3 layers in CSE vs. 7 in OSI

    • Trivial ones: link layer vs. data link + physical

    • End-to-end layer vs. 4 distinct layers

      • Application knows best

      • Don’t bury it in a lower layer, let the end points deal with it because they know best what they need

      • Use library instead of layers, e.g. RPC

  • Example: file transfer

    • Checksum in end-to-end layer

    • Checksum in link layer


Layers in OSI, TCP/IP & CSE

7th Application Layer

Application Layer

End-to-End Layer

6th Presentation Layer

5th Session Layer

4th Transport Layer

Transport Layer

3th Network Layer

Network Layer

Network Layer

2nd Link Layer

Link Layer

Link Layer

1st Physical Layer




The internet hour glass

The Internet “Hour Glass”

Mapped applications

Mapped applications

  • Mapped composition

    • A network layer is built on another network layer

    • Mapping higher-layer network addresses to lower-layer network address

      • e.g. Appletalk maps its network layer to Ethernet

    • Internet: links many different network layers together, mapping to IP network layer

      • ARP/RARP: mapping Ethernet addr to and from IP addr

      • Other networks: wireless, satellite, cable TV, etc.

Recursive applications

Recursive applications

  • Recursive composition

    • A network layer rests on a link layer that itself is a complete three-layer network

    • A dial-up telephone line as an attachment point of the Internet, which goes through a telephone network

    • An overlay network uses an existing network as links, e.g. Gnutella

    • VoIP, voice telephone network on the Internet

    • A tunnel, e.g. VPN

Recursive network composition

Recursive network composition

  • Gnutella is a large decentralized P2P network

  • The link layer itself is a network

Link layer2

Link Layer

The link layer

The link layer

  • The bottom-most layer of the three layers

  • Responsible for moving data directly from one physical location to another

    • Physical transmission

    • Framing bits & bit sequences

    • Detecting transmission errors

    • Multiplexing the link

    • Providing a useful interface to the up layer

Transmitting digital data

Transmitting digital data

  • Three-wire ready/acknowledge protocol

    • A places data on data line

    • A changes value on the ready line

    • B sees the ready line change, reads value on the data line, then changes the acknowledge line

    • B: when to look at the data line?

    • A: when to stop holding the bit value on the data line?

Parallel vs serial

Parallel vs. serial

  • Propagation time ∆t

    • It takes more than 2∆t to send one bit

    • The max data rate is 1/(2∆t)

  • Parallel transmission

    • Use N parallel data lines to achieve N/(2∆t)

    • E.g. SCSI, printer, etc.

  • Serial transmission

    • Higher rates, longer distance, fewer wires

Signal transmission on analog line

Signal transmission on analog line

  • It is hard for B to understand the signal

Vco manchester code

VCO & Manchester code

  • VCO: Voltage Controlled Oscillator

    • Sender and receiver agree on an approximate data rate

    • The receiver runs a VCO at about the same data rate

    • phase-locked loop: locked VCO becomes a clock source

    • Problem: no transitions in the data stream

    • E.g. a long string of zeros, phase-locked loop can’t sync

    • Solution: sender encodes the data to ensure transitions

      • Phase encoding: at least 1 level transition for a bit

      • Manchester code: 0 -> 01, 1 -> 10

        • Max data rate is only half, but simple enough

      • Other encoding: 1 level transition for everyfew bits

Framing frames

Framing frames

  • Where a frame begins and ends

  • Independent from framing bits

    • That’s why some model separates link layer to two: one for bits and one for frames

  • Simple method

    • Choose some pattern of bits, e.g. seven one-bits in a row, as a frame-separator mark

    • Bit stuffing: if data contains six ones in a row, then stuffs an extra bit (0) into the stream

Error handling

Error handling

  • Error detection code

    • Adding redundancy

    • Checksum at the end

  • What to do if detect an error

    • Error correction code: with enough redundancy

      • Where noise is well understood, e.g. disk

    • Ask sender to resend: sender hold frame in buffer

    • Let receiver discard the frame

    • Blending these techniques

Coding incremental redundancy

Coding: incremental redundancy

  • Forward error correction

    • Perform coding before storing or transmitting

    • Later decode the data without appealing to the creator

  • Hamming distance

    • Number of 1 in A ⊕ B , ⊕ is exclusive OR (XOR)

    • If H-distance between every legitimate pair is 2

      • 000101, can only detect 1-bit flip

    • If H-distance between every legitimate pair is 3

      • Can only correct 1 bit flip

    • If H-distance between every legitimate pair is 4

      • Can detect 2-bit flip, correct 1-bit flip

Examples 1


  • Example-1: simple parity check

    • 2 bits -> 3 bits

    • Detect 1-bit errors

    • Only 4 correct patterns

      • 00 -> 000

      • 11 -> 110

      • 10 -> 101

      • 01 -> 011

    • Hamming distance of this code is 2

      • 1-bit flipping will cause incorrect pattern

Example 2


  • 4 bits -> 7 bits (56 using only extra 7)

    • 3 extra bits to distinguish 8 cases

    • e.g. 1101 -> 1010101

  • Correct 1-bit errors

    • 1010101 -> 1010001 : P1 & P4 not match

    • 1010101 -> 1110101 : P2 not match






















Link layer interface

Link layer interface

  • LINK_SEND (data_buffer, link_identifier)

  • LINK_SEND (data_buffer, link_identifier, link_protocol, network_protocol)

  • Use different link protocol on a given link

    • E.g. wireless link switches to a “robustness” protocol

  • Use different network protocol on a given link

    • E.g. IP, Appletalk, ARP using the same link

    • Sender may add it to the link-level packet header

    • Receiver exams the field of header

Link properties

Link properties

  • Link types

    • A point-to-point link

      • Directly connects exactly two entities

    • Simplex link & duplex link

    • Half-duplex link & full-duplex link

    • Broadcast link

      • WiFi: one transmitter at a time, CDMA: many transmitter

  • Why MTU (Maximum Transmission Unit)?

    • Error handling, packet discard, hardware buffer limit







Link layer interface1

Link layer interface

structure frame

structure checked_contents

bit_stringnet_protocol// multiplexing


bit_string payload // payload data

bit_string checksum

Link layer interface2

Link layer interface

procedure LINK_SEND (data_buffer, link_identifier,

link_protocol, network_protocol)

frame instance outgoing_frame

outgoing_frame.checked_contents.payload ← data_buffer

outgoing_frame.checked_contents.net_protocol ←


frame_length ← LENGTH (data_buffer) + header_length

outgoing_frame.checksum ← CHECKSUM (

frame.checked_contents, frame_length)

sendproc ← link_protocol[that_link.protocol]

sendproc (outgoing_frame, frame_length,

link_identifier) // Send frame.

Link layer interface3

Link layer interface

procedure LINK_RECEIVE (received_frame, length, link_id)

frame instance received_frame

if CHECKSUM (received_frame.checked_contents, length)

= received_frame.checksum

then // Pass good packets up to next layer.

good_frame_count ← good_frame_count + 1;





bad_frame_count← bad_frame_count + 1 // Just

count damaged frame.


// Each network layer protocol handler call SET_HANDLER before the first packet for that protocol arrives…

procedure SET_HANDLER (handler_procedure,


net_handler[handler_protocol] ← handler_procedure

procedure GIVE_TO_NETWORK_HANDLER (received_packet,


handler ← net_handler[network_protocol]

if (handler ≠ NULL) call handler(received_packet,


else unexpected_protocol_count ←

unexpected_protocol_count + 1

Network layer1

Network Layer

The network layer

The network layer

  • Addressing interface

    • Network attachment points

    • Network address

    • Source & destination

  • NETWORK_SEND (segment_buffer, destnation, network_protocol, end_layer_protocol)

  • NETWORK_HANDLE (packet, network_protocol)

Ip datagram packet package

IP datagram (packet, package)






......... 1011011001010100011001001010110


Ip route table

IP route table

Inside a router

Inside a router

Forwarding an ip packet

Forwarding an IP Packet

  • Lookup packet’s DST in forwarding table

    • If known, find the corresponding outgoing link

    • If unknown, drop packet

  • Decrement TTL

    • Drop packet if TTL is zero

  • Update header Checksum

  • Forward packet to outgoing port

  • Transmit packet onto link

Network layer interface

Network layer interface

structure packet

bit_string source

bit_string destination

bit_string end_protocol

bit_string payload


1 procedure NETWORK_SEND (segment_buffer, destination,

2 net_protocol, end_protocol)

3 packet instance outgoing_packet

4 outgoing_packet.payload ← segment_buffer

5 outgoing_packet.end_protocol ← end_protocol

6 outgoing_packet.source ← MY_NETWORK_ADDRESS

7 outgoing_packet.destination ← destination

8 NETWORK_HANDLE (outgoing_packet, net_protocol)

9 procedureNETWORK_HANDLE (net_packet, net_protocol)

10 packet instancenet_packet

11 ifnet_packet.destination != MY_NETWORK_ADDRESS then

12 next_hop← LOOKUP (net_packet.destination, forwarding_table)

13 LINK_SEND (net_packet, next_hop, link_protocol, net_protocol)

14 else

15 GIVE_TO_END_LAYER (net_packet.payload,

16 net_packet.end_protocol, net_packet.source)







struct packet









struct frame











    • Packet forwarding

    • Source can send to itself


    • It should be…

  • What does LOOKUP do?

    • Check forwarding table

Managing the forwarding table routing

Managing the forwarding table: routing

  • Routing (or path-finding)

    • Constructing the tables

  • Impractical by hand

    • Determining the best paths requires calculation

    • Recalculating the table when links change

    • Recalculating the table when link fails

    • Adapt according to traffic congestion

  • Static routing vs. adaptive routing

    • Adaptive routing requires exchange of info

Path vector exchange

Path vector exchange

  • Each participant maintains a path vector

    • A complete path to some destination

    • E.g. zero-length path to itself

    • Gradually learns about other paths

    • Construct a new forwarding table from its new path vector

  • Algorithm

    • Advertising

    • Path selection

Path vector exchange1

Path vector exchange

  • Need coordination, no loop



Question on path vector

Question on Path Vector

  • How do we avoid permanent loops?

  • What happens when a node hears multiple paths to the same destination?

  • What happens if the graph changes?

Question on path vector1

Question on Path Vector

  • How do we avoid permanent loops?

    • When a node updates its paths, it never accepts a path that has itself

  • What happens when a node hears multiple paths to the same destination?

    • It picks the better path

  • What happens if the graph changes?

    • Algorithm deals well with new links

    • To deal with links that go down, each router should discard any path that a neighbor stops advertising

Hierarchical address assignment routing

Hierarchical address assignment & routing

  • Two problems of the implementation

    • Every attachment point must have a unique address

    • The path vector grows in size with the number of attachment points

  • Hierarchy

    • Tow parts of network address: region & station

      • E.g. “11,75”

    • Regions correspond to the set of closely-connected entities

    • Region 11 has only 1 entry in other region routers’ table

    • First forward to region, then to station

Hierarchical address assignment routing1

Hierarchical address assignment & routing

Hierarchical address assignment routing2

Hierarchical address assignment & routing

  • Problems introduced by hierarchy

    • More complex

    • Binding address with location

      • Has to change address after changing location

    • Paths may no longer be the shortest possible

      • Algorithm has less detailed information

  • More about hierarchy

    • Can extend to more levels

    • Different places can have different levels

Reporting network layer errors

Reporting network layer errors

  • Typical error reports

    • The buffers of the router were full, so the packet had to be discarded

    • The buffers of the router are getting full—please stop sending so many packets

    • The region identifier part of the target address does not exist

    • The station identifier part of the target address does not exist

    • The end type identifier was not recognized

    • The packet is larger than the maximum transmission unit of the next link

    • The packet hop limit has been exceeded

  • What about sending report when checksum is error?

Reporting network layer errors1

Reporting network layer errors

  • Cross layers error message

    • Originates in the network layers, is delivered to the end-to-end layer

    • Violating the separation of layers?

  • Error reporting protocol: best-effort

    • Reliable protocol adds a lot

    • Can be thought of hints, not essential

    • E.g. ICMP

      • ping

    • Hop limit exceeded

    • Learn the smallest MTU by “MTU exceeded” error

Nat network address translation

NAT (Network Address Translation)

  • Private network

    • Public routers don’t accept routes to network 10

  • NAT router: bridge the private networks

    • Router between private & public network

    • Send: modify source address to temp public address

    • Receive: modify back by looking mapping table

  • Limitations

    • Some end-to-end protocol place address in payloads

    • The translator may become the bottleneck

    • What if two private network merge?

  • Login