View
213
Download
0
Tags:
Embed Size (px)
Citation preview
Packet Boundary Markers• There are various techniques to mark the
beginning/end of a packet• Bit stuffing
– Marker is a sequence of six 1’s– To ensure six 1’s do not appear in the data, the
transmitter adds an extra 0 after five consecutive 1’s
– Receiver knows if the next bit after five consecutive 1’s is a 0, the 0 should be removed and ignored
– If the next bit is a 1, it is the beginning or end of a packet
Packet Headers and Trailers
The sending node adds envelopes (headers and trailers) to packets as the packets are passed downwards from layer to layer
Envelopes
ApplicationApplication
PresentationPresentation
SessionSession
TransportTransport
NetworkNetwork
Data LinkData Link
PhysicalPhysical
SH
TH SH
NH TH SH
DH NH TH SH
DH NH TH SH
SH
TH SH
NH TH SH
DH NH TH SH
DH NH TH SH
SDUs and PDUs
• Each sending unit layer communicates with its peer receiving unit layer through a Protocol Data Unit (PDU)
• When layer n+1 passes information to layer n for transmission, the information is known as a Service Data Unit (SDU)
Connectionless Protocol
Layer n – 1 offers two functions:
• Sender accepts packets for transmission from layer n
• Receiver delivers packets to layer n
Connection-Oriented Protocol
• A connection must be established before data can be transferred– The connection is set up
– Data is transferred (sender) or received (receiver)
– The connection is terminated
• Either layer n requests connection/release to/from some destination address (sender) or layer n–1 informs layer n that the layer n process in the sending node requests connection/release
Types of Services
• Datagram (best-effort) – Accepts data but makes no guarantee of delivery. Data can be lost, duplicated, out of sequence, or mangled
• Reliable – Service either guarantees or claims data will be delivered in order, without corruption, mangling or loss
Service Protocols
connection oriented
connectionless
datagram ATM IP, IPX DECnet
reliable X.25
Reliable Service
• Reliability comes at a cost. Layer n–1 is more costly and less efficient
• Reliability may be provided at more than one layer, but it need not be provided at every layer
Some Alternatives• Two types of data link layer Logical link
Control (LLC) are offered over LANs– LLC Type 1 – is a connectionless
datagram service– LLC Type 2 – is a reliable connection
oriented service
• ISO defines two network layers:– Connection-Oriented Network Service
(CONS) – Connectionless Network Service (CLNS)
TCP/IP
• IP is connectionless
• There are two transport layer protocols:– Transmission Control Protocol (TCP) – is
reliable connection-oriented service– User Datagram Protocol (UDP) – is
datagram service
Important Network Properties
Scope
• Solve as general of a problem as possible
• Support a wide range of applications, broad spectrum of applications and many underlying technologies
Scalability
• Work well as a large network and be efficient as a small network
• Nowadays, large means millions or even trillions of nodes
Autoconfigurability
Networks must run themselves instead of relying on constant complex and costly human tweaking
Tweakability
• Networks that come with reasonable defaults should be autoconfiguring
• They should incorporate times and other parameters that network managers can play with to optimize performance for specific conditions
Determinism
• Identical conditions should yield identical results
• Routes should be identical givin identical physical topologies
• If networks are not deterministic, routes might differ depending on the order nodes are brought up in the network
• Not everyone feels determinism is worth the price
Migration
• A network design will not last forever• It is important to design network protocols so
that new features can be added to nodes one at a time without disrupting current operations
• It is important to be able to make modification, such as address changes, in a node-by-node fashion without disrupting network operations
Robustness
• Continue to operate even when nodes or links fail
• Network algorithm should adapt to changes in topology
• Undetected data errors can cause undetected corruption. Defective implementations can attach to the network and cause unpredictable behavior
• Humans (notoriously unreliable components of the system) frequently misconfigure things
Types of Robostness
Safety Barriers• A design where a fault does not spread
beyond a safety barrier• Corruption is confined to only a portion of the
network• For example, broadcast storm is a severe
congestion event. With IP, a broadcast storm on one LAN can incapacitate another LAN connected by a bridge, but the storm would be not be spread to the second LAN if the two LANs are connected by a router.
• Network can also be partitioned into areas or domains
Self Stabilization• After any sort of database corruption, the network will
return to normal operation without human intervention• Advanced Research Projects Agency Network
(ARPANET) was not self-stabilizing• Self stabilization does not guarantee network will
function properly with an offending device, but it will return to normal when the device is removed
• Turning the power on and off (power cycling) will often works as an instant repair, but networks don’t have on/off switches
• The network is not self-stabilizing if a saboteur can insert a few bad packets and bring the network down forever or until costly human intervention occurs
• If the saboteur must constantly insert destabilizing packets, he will be caught.
Fault Detection
• It is desirable for a network to diagnose itself, identifying faulty equipment
• Networks vary greatly in their fault detection capabilities
Byzantine Robustness
• The term Byzantine failure is taken from a famous computer science problem know as the Byzantine general’s problem
• Node failure not because it ceases operation, but rather because of defective operation, i.e., hardware fault or sabotage.
• Byzantine robustness is when nodes continue to function properly in the face of Byzantine failures
Simple Protocol – No ErrorsTransmitter Receiver
100
ack
0f
ack
rom
ack
etc
Assume packets can store only 3 characters
Detecting a Lost Ack
• Implement timer at sender• If timer is too small, packets will be needlessly
retransmitted– Transmitting packets needlessly adds processing
burden on the recipient– Recipient is already too overloaded to return ack in
time
• If timer is too large, throughput will decrease after packet loss because packet retransmission is delayed
Simple protocol – Lost AckTransmitter Receiver
100
XXX ack gets lost
100``
ack
0f
ack
rom
ack
etc
Packet Timeout Problem
If packet is not really lost, 1000 transmitted by sender could be received as 1001000
Adding Packet Numbers
Transmitter Receiver
100 (#1)
XXX ack (#1) gets lost
100 (#1)
ack (#1)
0f (#2)
ack (#2)
rom (#3)
ack (#3)
etc
Packet Numbering
• It would be nice to have unlimited size for packet numbers
• However, that would waste space• Packet numbers are usually limited to some
maximum size that wraps around• Assume packet numbers are represented by 3 bits
(in real protocols the number would be much larger)
• Packet numbers are 0,1,2,3,4,5,6,7
Packet Numbering Problems• Transmit 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3
– If all packets after the first 4 are lost– Receiver could send ack #3 and sender and receiver
would assume all packets arrived properly
• Transmit 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3– If the packets are permuted into a random order with
datagram service– which packet 2 arrives first?
• Transmit 0, 1, 2, 3, 4, 5, 6, 7– If ack (#7) is sent but gets lost in transit– The transmitter resends all packets which are accepted
as new data by the receiver
Packet Ordering Solutions• Design window sizes carefully• Packet number size should be large enough so that
packet number cannot wrap around in the worst-case delay time
• For example, if it is conceivable that a network could delay a packet by 15 sec, it must not be possible for a transmitter (at maximum speed) to transmit enough packets so that the packet number will wrap around in 15 secs
• Window size should be no larger than half the packet number