we have learned last time csci4211: weekly summary1 weekly summary part i
Post on 11-Jan-2016
214 Views
Preview:
TRANSCRIPT
We Have Learned Last Time
CSci4211: Weekly Summary
1
Weekly SummaryPart I
CSci4211: Weekly Summary 2
What We Learned Last Time (Sep 10) What is a network? What is a computer/data network?
Compare w/ diff. networks (telephone, postal office, transportation networks, …) “bolts-&-nuts” view vs. service perspective
Network is a shared resource! ways to share (“multiplex”) resources? TDMA, FDMA, CDMA,
… Packet switching vs. circuit switching:
packets, packet switching and statistical multiplexing• For “bursty” data applications• store-&-forward
delay, losses and congestion vs. call blocking New: four types of delays
propagation, transmission, processing & queueing delays
Architecture: layering & hourglass different technologies, “boxes” (routers, switches), & apps Protocols and Interfaces (API)
CSci4211: Introduction 3
Switching & Multiplexing• Network is a shared resource
– Provide services for many people at same time– Carry bits/information for many people at same time
• How do we do it? – Switching: how to deliver information from point A to
point B?– Multiplexing: how to share resources among many
users
Think about postal service and telephone system!
Switching and multiplexing are closely related!
CSci4211: Introduction 4
Switching/Multiplexing Strategies
• Circuit switching– set up a dedicated route (“circuit”) first – carry all bits of a “conversation” on one circuit
• original telephone network• Analogy: railroads and trains/subways
• Packet switching– divide information into small chunks (“packets”)– each packet delivered independently – “store-and-forward” packets
• Internet (also Postal Service, but they don’t tear your mail into pieces
first!)• Analogy: highways and cars
• Pros and Cons? - think taking subways vs. driving cars, during off-peak vs. rush hours!
Analogy: railroad and train
CSci4211: Introduction 5
Analogy: Highway and cars
CSci4211: Introduction
6
Circuit Switchingnetwork resources
(e.g., bandwidth) divided into “pieces”
• pieces allocated to calls
• resource piece idle if not used by owning call (no sharing)
dividing link bandwidth into “pieces” frequency division time division code division
Trivia Q:You must have heard of the term “CDMA” (think the company Qualcom, for which it is most associated with), what does “CD” in CDMA stands for?
CSci4211: Introduction
7
Circuit Switching: FDM and TDM
FDM
frequency
time
TDM
frequency
time
4 users
Example:
CSci4211: Introduction
8
Networks with Circuit Switchinge.g., conventional (fixed-line) telephone
networks
End-end resources reserved for “call”
• link bandwidth, switch capacity
• dedicated resources: no sharing
• circuit-like (guaranteed) performance
• call setup required
CSci4211: Introduction 9
CSci4211: Introduction 10
Circuit Switched Networks• All resources (e.g. communication links)
needed by a call dedicated to that call for its duration– Example: telephone network– Call blocking when all resources are used
Numerical example• How long does it take to send a file of
640,000 bits from host A to host B over a circuit-switched network?– All links are 1.536 Mbps– Each link uses TDM with 24 slots/sec– 500 msec to establish end-to-end circuit
Let’s work it out!
10.5 seconds
CSci4211: Introduction 11
Packet SwitchingEach end-end “data
stream” divided into packets
• users A, B packets share network resources
• each packet uses full link bandwidth
• resources used as needed
resource contention: aggregate resource
demand can exceed amount available
congestion: packets queue, wait for link use
store and forward: packets move one hop at a time Node receives complete
packet before forwarding Packets may suffer delay or
losses!
Bandwidth division into “pieces”
Dedicated allocationResource reservation
12CSci4211: Introduction
CSci4211: Introduction 13
Statistical Multiplexing
• Time division, but on demand rather than fixed• Reschedule link on a per-packet basis• Packets from different sources interleaved on the link• Buffer packets that are contending for the link• Buffer buildup is called congestion• This is packet switching, used in computer networks
Packet Switching: Statistical Multiplexing
Sequence of A & B packets does not have fixed pattern, shared on demand statistical multiplexing.
TDM: each host gets same slot in revolving TDM frame.
A
B
C100 Mb/sEthernet
1.5 Mb/s
D E
statistical multiplexing
queue of packetswaiting for output
link
14CSci4211: Introduction
Packet-switching: store-and-forward
• Takes L/R seconds to transmit (push out) packet of L bits on to link or R bps
• Entire packet must arrive at router before it can be transmitted on next link: store and forward
• delay = 3L/R (assuming zero propagation delay)
Example:• L = 7.5 Mbits• R = 1.5 Mbps• delay = ?
R R RL
more on delay later …
15 sec
CSci4211: Introduction
15
Packet switching versus circuit switching
• 1 Mb/s link• each user:
– 100 kb/s when “active”
– active 10% of time
• circuit-switching: – 10 users
• packet switching: – with 35 users,
probability > 10 active less than .0004
Packet switching allows more users to use network!
N users
1 Mbps link
Q: how did we get value 0.0004?
M
Nn
nMn ppn
M
1
1
CSci4211: Introduction
16
CSci4211: Introduction 17
Circuit Switching vs Packet SwitchingItem Circuit-
switchedPacket-switched
Dedicated “copper” path Yes No
Bandwidth available Fixed Dynamic
Potentially wasted bandwidth Yes No (not really!)
Store-and-forward transmission No Yes
Each packet/bit always follows the same route
Yes Not necessarily
Call setup Required Not Needed
When can congestion occur At setup time On every packet
Effect of congestion Call blocking Queuing delay
Four sources of packet delay
1. nodal processing: • check bit errors• determine output link
A
B
propagation
transmission
nodalprocessing queueing
2. queueing• time waiting at output
link for transmission • depends on congestion
level of router
CSci4211: Introduction18
CSci4211: Introduction 19
Delay in packet-switched networks
3. Transmission delay:• R=link bandwidth
(bps)• L=packet length
(bits)• time to send bits into
link = L/R
4. Propagation delay:• d = length of physical
link• s = propagation speed
in medium (~2x108 m/sec)
• propagation delay = d/s
A
B
propagation
transmission
nodalprocessing queueing
Note: s and R are very different quantitites!
Nodal delay
• dproc = processing delay– typically a few microsecs or less
• dqueue = queuing delay– depends on congestion
• dtrans = transmission delay– = L/R, significant for low-speed links
• dprop = propagation delay– a few microsecs to hundreds of msecs
proptransqueueprocnodal ddddd
CSci4211: Introduction20
CSci4211: Introduction 21
Statistical Multiplexing and Queueing
A
B
C10 MbsEthernet
1.5 Mbs
45 Mbs
D E
statistical multiplexing
queue of packetswaiting for output
link
CSci4211: Introduction 22
Queueing delay (revisited)
• R=link bandwidth (bps)
• L=packet length (bits)
• a=average packet arrival ratetraffic intensity = La/R
• La/R ~ 0: average queueing delay small• La/R -> 1: delays become large• La/R > 1: more “work” arriving than can
be serviced, average delay infinite!
Queueing delay and Packet loss
• Queue (aka buffer) preceding link in buffer has finite capacity
• When packet arrives to full queue, packet is dropped (aka lost)
• lost packet may be retransmitted by previous node, by source end system, or not retransmitted at all
CSci4211: Introduction23
“Real” Internet delays and routes
• What do “real” Internet delay & loss look like? • Traceroute program: provides delay
measurement from source to router along end-end Internet path towards destination. For all i:– sends three packets that will reach router i on path
towards destination– router i will return packets to sender– sender times interval between transmission and
reply.
3 probes
3 probes
3 probes
CSci4211: Introduction24
“Real” Internet delays and routes
Let’s Traceroute to www.bbc.com
CSci4211: Introduction25
Throughput• throughput: rate (bits/time unit) at
which bits transferred between sender/receiver– instantaneous: rate at given point in time– average: rate over longer period of time
server, withfile of F bits
to send to client
link capacity
Rs bits/sec
link capacity
Rc bits/sec pipe that can carry
fluid at rate
Rs bits/sec)
pipe that can carryfluid at rate
Rc bits/sec)
server sends bits
(fluid) into pipe
CSci4211: Introduction 26
Throughput (cont’d)
• Rs < Rc What is average end-end throughput?
Rs bits/sec Rc bits/sec
Rs > Rc What is average end-end throughput?
Rs bits/sec Rc bits/sec
link on end-end path that constrains end-end throughput
bottleneck link
CSci4211: Introduction27
Throughput: Internet scenario
10 connections (fairly) share backbone bottleneck link R
bits/sec
Rs
Rs
Rs
Rc
Rc
Rc
R
• per-connection end-end throughput: min(Rc,Rs,R/10)
• in practice: Rc or Rs is often bottleneck
CSci4211: Introduction 28
CSci4211: Weekly Summary 29
Introduction (cont’d) Key network functions: -- naming, addressing, routing & forwarding
networks are distributed & complex systems!
What’s so special about the Internet? -- Internet Architecture: layering & hourglass
different technologies, “boxes” (routers, switches), & apps
Protocols and Interfaces (API)
What today’s Internet looks like? economics & policies
What may go wrong? bit errors, packet losses,, node failures, software bugs, app
crashes. ….. and Attacks !!!
CSci4211: Introduction 30
What’s so special about the Internet?
• Internet is based on the notion of “packet switching”– enables statistical multiplexing– better utilization of network resources for transfer of
“bursty” data traffic • Internet’s key organizational/architectural principle:
“smart” end systems + “dumb” networks– architecture: functional division & function placement– hourglass Internet architecture: enables diverse
applications and accommodates evolving technologies– “dumb” network (core): simple packet-switched, store-
forward, connectionless “datagram” service, with core functions: global addressing, routing & forwarding
– “smart” end systems/edges: servers, PCs, mobile devices, …; diverse and ever-emerging new applications!
CSci4211: Introduction 31
Internet Hourglass Architecture
WiFi, Bluetooth,Docsis, gMPLS, DWDM/fiber, …,3G/4G cellular, ….
p2p file sharing, skype, YouTube, Netflix, Cloud Computing
bitTorrent, DHT, SIP, DASH, ….
enabling diverse applications & new types of end devices
accommodating evolving & new technologies
netw
ork
core
netw
ork
edge
/end
hos
ts
Internet Protocol Stack• application: supporting network
applications– FTP, SMTP, HTTP, DASH, …
• transport: process-process data transfer– TCP, UDP
• network: routing of datagrams from source to destination– IP, routing protocols
• link: data transfer between neighboring network elements– PPP, Ethernet
• physical: bits “on the wire”
application
transport
network
link
physical
CSci4211: Introduction
32
CSci4211: Introduction 33
Layered Architecture
• Layering simplifies the architecture of complex system
• Layer N relies on services from layer N-1 to provide a service to layer N+1
• Interfaces define the services offered
• Service required from a lower layer is independent of its implementation– Layer N change doesn’t affect
other layers– Information/complexity hiding– Similar to object oriented
methodology
CSci4211: Introduction 34
Protocols and Services• Protocols are used to implement services
– Peering entities in layer N provide service by communicating with each other using the service provided by layer N-1
• Logical vs physical communication
What’s a protocol?human protocols:• “what’s the time?”• “I have a question”• introductions
network protocols:• machines rather
than humans• all communication
activity in Internet governed by protocols (why this concept is so important!!!)
CSci4211: Introduction
35
CSci4211: Introduction 36
Protocol Packets• Protocol data units (PDUs):
– packets exchanged between peer entities• Service data units (SDUs):
– packets handed to a layer by an upper layer• Data at one layer is encapsulated in packet at a lower
layer– Envelope within envelope: PDU = SDU + (optional)
header or trailer
sourceapplicatio
ntransportnetwork
linkphysical
HtHn M
segment Ht
datagram
destination
application
transportnetwork
linkphysical
HtHnHl M
HtHn M
Ht M
M
networklink
physical
linkphysical
HtHnHl M
HtHn M
HtHn M
HtHnHl M
router
switch
Encapsulationmessage M
Ht M
Hn
frame
CSci4211: Introduction 37
CSci4211: Weekly Summary 38
Introduction (cont’d) Key network functions: -- naming, addressing, routing & forwarding
networks are distributed & complex systems!
What’s so special about the Internet? -- Internet Architecture: layering & hourglass
different technologies, “boxes” (routers, switches), & apps
Protocols and Interfaces (API)
What today’s Internet looks like? -- economics & policies
What may go wrong? bit errors, packet losses,, node failures, software bugs, app
crashes. ….. and Attacks !!!
CSci4211: Introduction 39
Internet Structure
LANs
International lines
Regional or local ISP local ISPs
company university
National or tier-1 ISP
National or tier-1 ISP
IXPsor private peering
Regional ISPs
company
access via WiFi hotspots
Internet: “networks of networks”!
Home users
Internet eXcangePoints
Home users
Internet structure: network of networks
• Roughly hierarchical• At center: “tier-1” ISPs (e.g., Verizon, Sprint, AT&T,
L3, Cable and Wireless), national/international coverage– treat each other as equals
Tier 1 ISP
Tier 1 ISP
Tier 1 ISP
Tier-1 providers interconnect (peer) privately
IXP
Tier-1 providers also interconnect at Internet Exchange Point
CSci4211: Introduction 40
Tier-1 ISP: e.g., Sprint
…
to/from customers
peering
to/from backbone
….
………
POP: point-of-presence
CSci4211: Introduction 41
Internet structure: network of networks
• “Tier-2” ISPs: smaller (often regional) ISPs– Connect to one or more tier-1 ISPs, possibly other tier-2
ISPs
Tier 1 ISP
Tier 1 ISP
Tier 1 ISP
IXP
Tier-2 ISPTier-2 ISP
Tier-2 ISP Tier-2 ISP
Tier-2 ISP
Tier-2 ISP pays tier-1 ISP for connectivity to rest of Internet tier-2 ISP is
customer oftier-1 provider
Tier-2 ISPs also peer privately with each other, interconnect at IXP
CSci4211: Introduction 42
Internet structure: network of networks
• “Tier-3” ISPs and local ISPs – last hop (“access”) network (closest to end systems)
Tier 1 ISP
Tier 1 ISP
Tier 1 ISP
IXP
Tier-2 ISPTier-2 ISP
Tier-2 ISP Tier-2 ISP
Tier-2 ISP
localISPlocal
ISPlocalISP
localISP
localISP Tier 3
ISP
localISP
localISP
localISP
Local and tier- 3 ISPs are customers ofhigher tier ISPsconnecting them to rest of Internet
CSci4211: Introduction43
Internet structure: network of networks
• a packet passes through many networks!
Tier 1 ISP
Tier 1 ISP
Tier 1 ISP
IXP
Tier-2 ISPTier-2 ISP
Tier-2 ISP Tier-2 ISP
Tier-2 ISP
localISPlocal
ISPlocalISP
localISP
localISP Tier 3
ISP
localISP
localISP
localISP
traceroute www.cnn.com
CSci4211: Introduction44
Routing & forwarding:how do packets gofrom A to B?
B
A
Map of Internet
CSci4211: Introduction 46
Fundamental Issues in NetworkingNetwork is a shared resource
– Provide services for many people at same time– Carry bits/information for many people at same time
• Switching and Multiplexing – How to share resources among multiple users, and
transfer data from one node to another node• Naming and Addressing
– How to find name/address of the party (or parties) you would like to communicate with
– Address: byte-string that identifies a node• unicast, multicast and broadcast addresses
• Routing and Switching/Forwarding: – process of determining how to send packets towards
the destination based on its address: finding out neighbors, building routing tables
– transferring data from source to destination
CSci4211: Introduction 47
Fundamental Problems in Networking …
Or what can go wrong?• Bit-level errors: due to electrical interferences• “Frame-level” errors: media access delay or
frame collision due to contention/collision/interference
• Packet-level errors: packet delay or loss due to network congestion/buffer overflow
• Out of order delivery: packets may takes different paths
• Link/node failures: cable is cut or system crash
CSci4211: Introduction 48
Fundamental Problems in Networking
What can be done?• Add redundancy to detect and correct
erroneous packets• Acknowledge received packets and retransmit
lost packets• Assign sequence numbers and reorder packets
at the receiver• Sense link/node failures and route around
failed links/nodesGoal: to fill the gap between what applications
expect and what underlying technology provides
What’s the Internet: Recap
• protocols control sending, receiving of messages– e.g., TCP, IP, HTTP, FTP,
PPP• Internet: “network of
networks”– loosely hierarchical– public Internet versus
private intranet• Internet standards
– RFC: Request for comments
– IETF: Internet Engineering Task Force
– IEEE
local ISP
companynetwork
regional ISP
router workstation
servermobile
CSci4211: Introduction 49
CSci4211: Introduction 50
Fundamental Issues in NetworkingNetwork is a shared resource
– Provide services for many people at same time– Carry bits/information for many people at same time
• Switching and Multiplexing – How to share resources among multiple users, and
transfer data from one node to another node• Naming and Addressing
– How to find name/address of the party (or parties) you would like to communicate with
– Address: byte-string that identifies a node• unicast, multicast and broadcast addresses
• Routing and Switching/Forwarding: – process of determining how to send packets towards
the destination based on its address: finding out neighbors, building routing tables
– transferring data from source to destination
CSci4211: Introduction 51
Fundamental Problems in Networking …
Or what can go wrong?• Bit-level errors: due to electrical interferences• “Frame-level” errors: media access delay or
frame collision due to contention/collision/interference
• Packet-level errors: packet delay or loss due to network congestion/buffer overflow
• Out of order delivery: packets may takes different paths
• Link/node failures: cable is cut or system crash
CSci4211: Introduction 52
Fundamental Problems in Networking
What can be done?• Add redundancy to detect and correct
erroneous packets• Acknowledge received packets and retransmit
lost packets• Assign sequence numbers and reorder packets
at the receiver• Sense link/node failures and route around
failed links/nodesGoal: to fill the gap between what applications
expect and what underlying technology provides
CSci4211: Introduction 53
Internet Summary• Computer networks/Internet use packet
switching• Layered architecture for handling complexity &
attaining maintainability– Key notions: protocols, services and interfaces
• Internet is based on TCP/IP protocol suite– Networks of networks!– Shared, distributed and complex system in global
scale– No centralized authority
• Fundamental issues in networking– addressing/naming – routing/forwarding– error/flow/congestion control, media access control
CSci4211: Introduction 54
The Internet Network layer
routingtable
Routing protocols• path selection• RIP, OSPF, BGP
IP protocol• addressing conventions• packet handling conventions
ICMP protocol• error reporting• router “signaling”
Transport layer: TCP, UDP
Data Link layer (Ethernet, WiFi, PPP, …)
Physical Layer (fiber optics, radio, …)
Networklayer
Internet Protocol Stack• application: supporting network
applications– FTP, SMTP, HTTP, DASH, …
• transport: process-process data transfer– TCP, UDP
• network: routing of datagrams from source to destination– IP, routing protocols
• link: data transfer between neighboring network elements– PPP, Ethernet
• physical: bits “on the wire”
application
transport
network
link
physical
CSci4211: Introduction
55
CSci4211: Weekly Summary 56
Stuff We Won’t Talk About or Elaborated on
Various Physical Media twisted pairs, co-axial cables, fiber optics, radio,
satellite, etc. Access Networks
DSL, Cable Modem, Fiber to the Curb/Home, … ISPs and Internet Backbones
CSci4211: Weekly Summary
57
CSci4211: Weekly Summary
58
Announcements & Reminders (Sep 18) Written Homework Assignment #1 due next Friday Oct 10 11:59pm (submit via moodle) please download wireshark! Project #1: will be out today, and Due Friday Oct 3 11:59 pm (submit via moodle)
Please start working on it as soon as possible!
Next Thursday (Sep 25): TAs will• talk about Java/Python Socket Programming
& APIs• Programming project #1• “hands-on” exercises via wireshark• “jeopardy” game!
CSci4211: Weekly Summary
59
What We Learned Last Time (Sept 11)• Review what is a Computer Network/Internet?
• Packet Switching vs. Circuit Switching• statistical multiplexing
• “Hourglass” Internet Architecture • layering and layered architecture: pros & cons? • notions of protocols, services & interfaces
• protocols: specify formats, rules & actions for “peer” communications
• Four components of packet delays:• propagation delay, transmission delay, processing
delay, and queueing delay • What Internet looks like today? “hierarchical”
structures• notions of “tiers” (tier-1, tier-2, …) of ISPs
CSci4211: Weekly Summary 60
What We Learned Last Time (Sept 11) …
Applications and Application Layer Protocols Basics of Building Applications: a networking perspective application processes and inter-process communications API: socket overview “Addressing” processes (“whom is the other party is”)
IP addresses and port numbers What transport services to use?
TCP and UDP Application Structures
client-server - data centers, cloud services peer-to-peer
Case studies: applications/application protocols world wide web and HTTP: transaction-oriented app protocol email and SMTP (& POP, IMAP): session-based app protocol
download“wireshark” software!
CSci4211: Weekly Summary
61
Web and HTTP Summary
GET /index.html HTTP/1.0 HTTP/1.0200 Document followsContent-type: text/htmlContent-length: 2090 -- blank line --HTML text of the Web page
Client Server
Transaction-oriented (request/reply), use TCP, port 80
CSci4211: Weekly Summary
62
Email SummaryAlice
Messagetransfer agent(MTA)
Messageuser agent(MUA)
outgoing mail queue
Bob Messagetransfer agent(MTA)
Messageuser agent(MUA)
user mailbox
client
server
SMTP over TCP(RFC 821)
port 25POP3 (RFC 1225)/ IMAP (RFC 1064) for accessing mail
SMTP
Questions?
CSci4211: Weekly Summary
63
CSci4211: Weekly Summary 64
Highlight of Today’s Lecture (Sept 18)
Domain Names & Domain Name System Peer-to-Peer programming paradigm
key problem in p2p programming paradigm?• how to find the other party? What’re the IP of and port
# used by the other party? Unstructured P2P Application Examples:
Napster, Gnutella, KaZaa, BitTorrent, Skype Distributed Hashing Tables (DHT) (very briefly)
A Quick Intro to Multimedia Networking YouTube and Netflix Overview
CSci4211: Weekly Summary
65
CSci4211: Application Layer 66
Internet Domain Names• Hierarchical: anywhere
from two to possibly infinity
• Examples: afer.cs.umn.edu, lupus.fokus.gmd.de– edu, de: organization type
or country (a “domain”)– umn, fokus: organization
administering the “sub-domain”
– cs, fokus: organization administering the host
– afer, lupus: host name (have IP address)
. (root)
. com . edu. uk
yahoo.comumn.edu
cs.umn.eduitlabs.umn.edu
afer.cs.umn.eduwww.yahoo.com
CSci4211: Weekly Summary
67
DNS example
Root name server:• may not know
authoritative name server
• may know intermediate name server: who to contact to find authoritative name server
requesting hosthomeboy.aol.com
afer.cs.umn.edu
root name server
local name serverdns.aol.com
1
23
4 5
6
authoritative name serverdns.cs.umn.edu
intermediate name serverdns.umn.edu.
7
8
CSci4211: Weekly Summary 68
What We Learned Last Time (Sept 26) …
Peer-to-Peer Applications: Napster, Gnutella, .. A Quick Primer on Multimedia Networking Overview of YouTube and Netflix Architectures
CSci4211: Weekly Summary
69
Reminders (Oct 2)
• Project #1: Due Tomorrow (Friday Oct 3 11:59 pm).
• Written Homework Assignment #1 due next Friday (Oct 10 11:59pm)
CSci4211: Weekly Summary 70
Highlight of Today’s Lecture (Oct 2)
Transport Layer: UDP and TCP Quickly go over UDP: connectionless service
header format: src/dst port #’s; checksum Focus on: TCP – connection-oriented service
header format: Seq. #, Ack#, flags, etc.
TCP Connection Management connection set-up: three-way handshake connection tear-down: “two-army” problem
Reliable Data Transfer the simple Stop-&-Wait (or Alternate Bit) protocol efficiency of protocols: issue w/ Stop-&-Wait Sliding window protocols: Go-Back-N & Selective
Repeat
CSci4211: Weekly Summary
71
CSci4211: Weekly Summary
72
Reminders (Oct 9)
Homework Written Assignment #1: Due Friday Oct 10 (11:59 pm).
• Programming Project #2: posted next Thursday, due Monday Nov 3, 11:59pm
• Take-Home Quiz I: hand out Wed Oct 22 (or Tuesday evening Oct 21), due Friday Oct 24!• will provide you with a sample quiz to work on early
next week
CSci4211: Weekly Summary 73
What We Learned Last Time (Oct 2)Transport Layer
• multiplexing and de-multiplexing
UDP: connectionless transport service • src/dst port no.’s, checksum
TCP: connection-oriented, reliable service • seq #, ack #, special “flags” (SYN, ACK, FIN, RST) • connection set-up: 3-way handshake• closing a connection: graceful wait
Reliable Data Transfer• simply reliable data transfer protocol : stop & wait
• efficiency of protocols: issue w/ stop-&-wait; pipelining
• sliding window protocols: Go-Back-N & Selective Repeat
CSci4211: Weekly Summary
74
What We Learned Last Time (Sep 26) ..
TCP: Some Key Issues • How to deal with “lost” packets?
• how to detect a packet is “lost”?• need to set a timer (“retransmission timer”)• what value shall we choose to set the timer?
• what to do with “lost” packets?• retransmit the “lost” packet
• What problem packet retransmission create?• (potential) duplicate packets
• e.g., when a “lost” packet is not actually lost, but takes longer to get delivered, after timer times out
• how to recognize duplicate packets?• sequence # (how many bits shall we use?)
• How to design a simple “reliable” transfer protocol?• stop-&-wait protocol (or alternative bit protocol)
• TCP connection management: set-up & tear-down
75
Question:
a. why “3-way”, not “2-way”?
b. What initial sequence # should client (and server) use?
c. What kind of “state” client and server need to maintain?
TCP 3-Way Hand-Shake
client
SYN, seq=x
server
SYN+ACK, seq=y, ack=x
ACK, seq=x, ack=y
initiate connection
connectionestablished
connection established
SYNreceived
(1st data segment)
CSci4211: Weekly Summary
76
Connection Setup Error Scenarios
• Importance of (unique) initial seq. no.?– When receiving SYN, how does server know it’s a new
connection request?– When receiving SYN+ACK, how does client know it’s a
legitimate, i.e., a response to its SYN request?
• Dealing with old duplicate (aka “ghost”) packets from old connections (or from malicious users)– If not careful: “TCP Hijacking”
• How to choose unique initial seq. no.?– randomly choose a number (and add to last syn# used)
• Other security concern:– “SYN Flood” -- denial-of-service attack
CSci4211: Weekly Summary
77
Connection Setup Error Scenarios
• Lost (control) packets– What happen if SYN lost? client vs. server actions– What happen if SYN+ACK lost? client vs. server
actions– What happen if ACK lost? client vs. server actions
• Duplicate (control) packets– What does server do if duplicate SYN received?– What does client do if duplicate SYN+ACK received?– What does server do if duplicate ACK received?
CSci4211: Weekly Summary
78
3-Way Handshake: Finite State Machine
Client FSM?
info (“state”) maintained at client?
Server FSM?
closed
Upper layer: initiate connection
?
?
sent SYN w/ initial seq =x
SYNsent
connestab’ed
?
?
SYN+ACK received
sent ACK
?
?
?
?
CSci4211: Weekly Summary
CSci4211: Weekly Summary
79
Client wants to close connection:
Step 1: client end system sends TCP FIN control segment to server
TCP: Closing ConnectionRemember TCP duplex connection!
client server
FIN
serverclosing
ACK
halfclosed
FINclientclosin
g
halfclosed
Step 2: server receives FIN, replies with ACK. half closed
Server finishes sending data, also ready to close:
Step 4: server sends FIN.
Step 3: client receives FIN.
half closed, wait for server to close
CSci4211: Weekly Summary
80
Step 5: client receives FIN, replies with ACK.– Enters “timed wait” - will
respond with ACK to received FINs
TCP: Closing Connection (revised)client
FIN
server
ACK
FIN
clientclosin
ghalf
closed
server
closing
halfclose
d
Two Army Problem!
Step 6: server, receives ACK. connection fully closed
full closed
fullclose
d
ACKStep 7: client, timer expires, connection fully closed
tim
ed w
ait ACK FINX timeout
81
TCP Connection Management FSM
TCP clientlifecycle
TCP client lifecycle
CSci4211: Weekly Summary
82
TCP Connection Management FSM
TCP serverlifecycle
TCP server lifecycle
CSci4211: Weekly Summary
83
Socket: Conceptual Viewsocket()
CSci4211: Weekly Summary
84
BSD Socket Programming (connectionless)
CSci4211: Weekly Summary
85
BSD Socket Programming Flows (connection-oriented)
CSci4211: Weekly Summary
CSci4211: Weekly Summary 86
What We Learned Last Time (Oct 2) …TCP: connection-oriented, reliable (in-order) data delivery -- connection management
Reliable Data Transfer Protocols Stop-&-Wait: a simple reliable data transfer protocol Efficiency of “Stop-&-Wait” reliable transfer protocol More Efficient Reliable Transfer Protocols
Sliding Window-based Go-Back-N Reliable Transfer Protocol Selective Repeat Key Issues: window size & “state maintenance” (to
keep sender & receiver in sync)
87
Simple Reliable Data Transfer Protocol
“Stop-and-Wait” Protocol – also called Alternating Bit Protocol
• Sender: – i) send data segment (n bytes) w/ seq =x
• buffer data segment, set timer, retransmit if time out – ii) wait for ACK w/ack = x+n; if received, set x:=x+n, go
to i) • retransmit if ACK w/ “incorrect” ack no. received
• Receiver:– i) expect data segment w/ seq =x; if received, send ACK
w/ ack=x+n, set x:=x+n, go to i) • if data segment w/ “incorrect” seq no received, discard data
segment, and retransmit ACK.
CSci4211: Weekly Summary
CSci4211: Transport Layer: Part II
88
• Can’t keep the pipe full– Utilization is low when bandwidth-delay product (R x RTT)is large!
Sender Receiver
data (L bytes)
ACK
first packet bit transmitted, t = 0
RTT
first packet bit arrives
ACK arrives, send next packet, t =
RTT + L / R
Problem with Stop & Wait Protocol
CSci4211: Weekly Summary
89
Stop & Wait: Performance Analysis
Example: 1 Gbps connection, 15 ms end-end prop. delay, data segment size: 1 KB = 8Kb
– U sender: utilization, i.e., fraction of time sender busy sending– 1KB data segment every 30 msec (round trip time) --> 0.027% x 1 Gbps = 33kB/sec throughput over 1 Gbps link
00027.0008.30
008.
*/
/
LRRTT
L
RLRTT
RLsenderU
ms 008.0s108
b/s 10
kb 8
bps) rate,ion (transmiss
bits)in length (packet
6
9transmit
R
LT
Moral of story: network protocol limits use of physical resources!
CSci4211: Weekly Summary
90
Pipelined ProtocolsPipelining: sender allows multiple, “in-flight”,
yet-to-be-acknowledged data segments– range of sequence numbers must be increased– buffering at sender and/or receiver
• Two generic forms of pipelined protocols: Go-Back-N and Selective Repeat
CSci4211: Weekly Summary
91
Pipelining: Increased Utilization
first packet bit transmitted, t = 0
sender receiver
RTT
last bit transmitted, t = L / R
first packet bit arriveslast packet bit arrives, send ACK
ACK arrives, send next packet, t = RTT + L / R
last bit of 2nd packet arrives, send ACKlast bit of 3rd packet arrives, send ACK
U sender
= .024
30.008 = 0.0008
microseconds
3 * L / R
RTT + L / R =
Increase utilizationby a factor of 3!
CSci4211: Weekly Summary
CSci4211: Weekly Summary
92
Reliable Data Transfer Protocols Reliable Data Transfer Protocols• basic mechanisms: seq. no, ACK, timer, retransmission• Simplest protocol: Stop-&-Wait
• To ensure correct operations of the protocol: at least 1-bit (0 or 1) needed for seq. no. (why?)
• More efficient reliable data transfer protocols• What’s the problem with Stop & Wait protocol?• Sliding window protocols: Go-Back-N and Selective Repeat
• concept of ”sliding window”• sender algorithm:
• when to retransmit, when to send new packets? when to move window forward?
• receiver algorithm: • when/what to acknowledge? when to move window
forward? when to buffer packets, and when to pass to upper layer?
• relationship between window size & seq. no. space
CSci4211: Weekly Summary
93
Go-Back-N: Basic IdeasSender:
• Packets transmitted continually (when available) without waiting for ACK, up to N outstanding, unACK’ed packets
• A logically different timer associated with each “in-flight” (i.e., unACK’ed) packet
• timeout(n): retransmit pkt n and all higher seq # pkts in windowReceiver:
• ACK packet if corrected received and in-order, pass to higher layer, NACK or ignore corrupted or out-of-order packets
• “cumulative” ACK: if multiple packets received corrected and in-order, send only one ACK with ack= next expected seq no.
CSci4211: Weekly Summary
94
Go-Back-N: Sliding Windows Sender:• “window” of up to N, consecutive unack’ed pkts allowed• send_base: first sent but unACKed pkt, move forward when ACK’ed
Receiver:• rcv_base: keep track of next expected seq no, move forward
when next in-order (i.e., w/ expected seq no) pkt received
may be received (and can be buffered, but not ACK’ed)
expected, not received yet
rcv_base
CSci4211: Weekly Summary
95
GBN in Action
CSci4211: Weekly Summary
96
Selective Repeat
• As in Go-Back-N– Packet sent when available up to window limit
• Unlike Go-Back-N– Out-of-order (but otherwise correct) is ACKed– Receiver: buffer out-of-order pkts, no “cumulative”
ACKs– Sender: on timeout of packet k, retransmit just pkt k
• Comments– Can require more receiver buffering than Go-Back-N– More complicated buffer management by both sides– Save bandwidth
• no need to retransmit correctly received packets
CSci4211: Weekly Summary
97
Selective Repeat: Sliding Windows
CSci4211: Weekly Summary
98
Selective Repeat in Action
CSci4211: Weekly Summary
99
Seqno Space and Window Size
• How big the sliding window can be?– MAXSEQNO: number of available sequence
numbers– Under Go-Back-N?
• MAXSEQNO will not work, why?– What about Selective-Repeat?
CSci4211: Weekly Summary
100
Selective Repeat: Dilemma
Example: • seq #’s: 0, 1, 2, 3• window size=3
• receiver sees no difference in two scenarios!
• incorrectly passes duplicate data as new in (a)
Q: what relationship between seq # size and window size?
CSci4211: Weekly Summary 101
Highlight of Remainder of Today’s Lecture (Oct 9)
We’ve spent a lot of recap what we have learned last time
• TCP connection management• Reliable data transfer protocols
Back to TCP: TCP primarily uses Go-Back-N
TCP Round-Trip-Time (RTT) Estimation TCP Flow Congestion
• receive-advertised window TCP Congestion Control
two phases: slow start & congestion avoidance
CSci4211: Weekly Summary
102
CSci4211: Weekly Summary
103
Announcement & Reminder (Oct 16)
• Programming Project #2: posted on the class website, due Monday Nov 3, 11:59pm• please take a look at it – if have questions, send email
to csci4211-help@cs.umn.edu• Please start working on it soon
• Take-Home Quiz I: hand out Wed Oct 22 (or Tuesday evening Oct 21), due Friday Oct 24!• sample quiz sent to the mailing list early this week• sample solution will be sent out tomorrow
CSci4211: Weekly Summary
104
What We Learned Last Time Before
Transport Layer Summary• Connectionless (UDP) vs. Connection-Oriented
(TCP) • port numbers & checksum
TCP: connection-oriented, reliable data transfer protocol -- key functions• connection management (set-up & tear-down)• reliable data transfer• flow control • Congestion control
• TCP Connection Management• TCP 3-way handshake connection setup
• why 3-way? why unique initial sequence numbers?• closing a connection: key issues and how TCP does it
• key issues: lost/delayed packets, old “ghost” packets
CSci4211: Weekly Summary
105
What We Have Learned Last Time• Review reliable data transfer protocols:
• stop-&-wait, & efficiency of protocols • Go-back-N, selective repeat: window size & seq. no. space
• round trip time estimation and TCP timeoutInterval• TCP Flow Control: avoid overwhelm receiver
• RecvWin: receiver advertises available buffer space• Congestion Control: avoid overwhelm network routers
• two approaches: end-to-end implicit vs. router-assisted
• TCP congestion control: end-to-end implicit• issue 1: how to determine network is congested• issue 2: how to adjust sending rate to avoid congestion• TCP congestion control mechanisms
• two parameters: ConWin, threshold• slow start • congestion avoidance: AIMD, duplicate ACKs,
timeout• fast retransmit/fast recovery
CSci4211: Weekly Summary
106
TCP Flow Control: How It Works
(Suppose TCP receiver discards out-of-order segments)
• spare room in buffer= RcvWindow= RcvBuffer-[LastByteRcvd -
LastByteRead]
• Rcvr advertises spare room by including value of RcvWindow in segments
• Sender limits unACKed data to RcvWindow– guarantees receive buffer
doesn’t overflow
CSci4211: Weekly Summary
107
TCP Slowstart
• exponential increase (per RTT) in window size (not so slow!)
• loss event: timeout (Tahoe TCP) and/or or three duplicate ACKs (Reno TCP)
initialize: Congwin = 1for (each segment ACKed) Congwin++until (loss event OR CongWin > threshold)
Slowstart algorithm Host A
one segment
RT
T
Host B
time
two segments
four segments
CSci4211: Weekly Summary
108
TCP Congestion Avoidance
/* slowstart is over */ /* Congwin > threshold */Until (loss event) { every W segments ACKed: Congwin++ }Threshold: = Congwin/2Congwin = 1perform slowstart
Congestion Avoidance
CSci4211: Weekly Summary
109
TCP Congestion Control: Recap
• end-end control (no network assistance)
• sender limits transmission: LastByteSent-LastByteAcked CongWin• Roughly,
• CongWin is dynamic, function of perceived network congestion
How does sender perceive congestion?
• loss event = timeout or 3 duplicate ACKs
• TCP sender reduces rate (CongWin) after loss event
three mechanisms:– AIMD– slow start– conservative after
timeout events
rate = CongWin
RTT Bytes/sec
CSci4211: Weekly Summary
110
TCP Congestion Control: Recap (cont’d)
• When CongWin is below threshold, sender in slow-start phase, window grows exponentially.
• When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly.
• When a triple duplicate ACKs occurs, threshold set to CongWin/2, and CongWin set to threshold.
• When timeout occurs, threshold set to CongWin/2, and CongWin is set to 1 MSS.
CSci4211: Weekly Summary
111
Highlight of Today’s Lecture (Oct 16)• Network Layer !
• basic functions: addressing, routing & forwarding• IP addresses and IP prefixes:
• 32 bits, dot notation• two-level hierarchy: network part & host part
• how to determine network part?• “classful” addressing scheme• “classless” addressing scheme: CIDR
• Where do you get an IP address?• manual config., or via DHCP -- how does it
work?• Where do you get an IP prefix?• Network Service Model: IP Datagram service
• destination-based, hop-by-hop, forwarding• forwarding (routing) table • table look-up: longest prefix matching
CSci4211: Weekly Summary
112
Routing & Forwarding:Logical View of a Router
A
ED
CB
F
22
13
1
1
2
53
5
CSci4211: Weekly Summary
113
CSci4211: Weekly Summary
114
Reminders (Oct 24)• Take-Home Quiz I: due tomorrow 5:30pm • please work individually, no discussion!
• We will answer any clarifying questions in the beginning of today’s lecture
• After you have finished your Take-Home Quiz I, please start working on your Project #2
• come to TAs’ office hours if you need help!
• Made a few changes and updates to the lecture notes (csci4211-network-part1.ppt), please re-download them!
CSci4211: Weekly Summary
115
What We Learned Last Time (Oct 17) …
• Network Layer• basic functions: addressing, routing & forwarding• IP addresses and IP prefixes:
• 32 bits, dot notation• two-level hierarchy: network part & host part
• how to determine network part?• “classful” addressing scheme• “classless” addressing scheme: CIDR
• Where do you get an IP address?• manual config., or via DHCP -- how does it
work?• Where do you get an IP prefix?• Network Service Model: IP Datagram service
• destination-based, hop-by-hop, forwarding• forwarding (routing) table • table look-up: longest prefix matching
CSci4211: Weekly Summary
116
IP Addressing: Network vs. Host
• Two-level hierarchy – network part (high order
bits)– host part (low order bits)
• What’s a network ? (from IP address perspective)
– device interfaces with same network part of IP address
– can physically reach each other without intervening router
223.1.1.1
223.1.1.3
223.1.1.4
223.1.2.2223.1.2.1
223.1.2.6
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.2
223.1.7.0
223.1.7.1223.1.8.0223.1.8.1
223.1.9.1
223.1.9.2
multi-accessLAN
point-to-point link
CSci4211: Weekly Summary
117
“Classful” IP Addressing
32 bits
0network host
10 network host
110 network host
1110 multicast address
A
B
C
D
class1.0.0.0 to127.255.255.255
128.0.0.0 to191.255.255.255
192.0.0.0 to223.255.255.255
224.0.0.0 to239.255.255.255
77 15 23 31
• Disadvantage: inefficient use of address space, address space exhaustion
• e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network
CSci4211: Weekly Summary
118
Classless Addressing: CIDR CIDR: Classless InterDomain Routing• Network portion of address is of arbitrary
length• Addresses allocated in contiguous blocks
– Number of addresses assigned always power of 2• Address format: a.b.c.d/x
– x is number of bits in network portion of address
11001000 00010111 00010000 00000000
networkpart
hostpart
200.23.16.0/23
CSci4211: Weekly Summary
119
Datagram vs. Virtual Circuit • Objective of both: move packets through routers from
source to destination• Datagram Model:
– Routing: determine next hop to each destination a priori
– Forwarding: destination address in packet header, used at each hop to look up for next hop
• routes may change during “session”– analogy: driving, asking directions at every gas station,
or based on the road signs at every turn • Virtual Circuit Model (will be studied today!):
– Routing: determine a path from source to each destination
– “Call” Set-up: fixed path (“virtual circuit”) set up at “call” setup time, remains fixed thru “call”
– Data Forwarding: each packet carries “tag” or “label” (virtual circuit id, VCI), which determines next hop
– routers maintain ”per-call” state
CSci4211: Weekly Summary
120
Datagram Networks: the Internet model
• no call setup at network layer• routers: no state about end-to-end connections
– no network-level concept of “connection”• packets forwarded using destination host
address– packets between same source-dest pair may take
different paths, when intermediate routes change!
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Send data 2. Receive data
CSci4211: Network Layer: Part I
121
IP Forwarding Table4 billion possible entries! (in reality, far less, but can still have millions of “routes”)
forwarding table entry format destination network next-hop (IP address) link interface (1st IP address , network mask ) 11001000 00010111 00010000 00000000, 200.23.16.1 0 11111111 11111111 11111000 00000000
11001000 00010111 00011000 00000000, - (direct) 1 11111111 11111111 11111111 00000000
11001000 00010111 00011001 00000000, 200.23.25.6 2 11111111 11111111 11111000 00000000
otherwise 128.30.0.1 3
Network Layer4-122
Route aggregation: Shrinking the forwarding table
“Send me anythingwith addresses beginning 200.23.0.0/20”
200.23.2.0/23
200.23.4.0/23
200.23.14.0/23
UMN
Organization 0
CSE DepartmentInternet
Organization 1
200.23.6.0/23Organization 2
...
...Port 1
Port 0
Port 7
CSci4211: Network Layer: Part I
Network Layer4-123
Route aggregation with more specific routes
UMN-2 has a more specific route to CSE department
“Send me anythingwith addresses beginning 200.23.0.0/20”
200.23.2.0/23
200.23.14.0/23
UMN
Organization 0
CSE DepartmentInternet
UMN-FAST “Send me anythingwith addresses beginning 200.23.14.0/23”
200.23.4.0/23Organization 2
...
...
CSci4211: Network Layer: Part I
124
Longest Prefix Matching
Prefix Match Link Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3
DA: 11001000 00010111 00011000 10101010
Examples
DA: 11001000 00010111 00010110 10100001 Which interface?
Which interface?
CSci4211: Network Layer: Part I
124
CSci4211: Network Layer: Part I
125
Longest Prefix Matching Prefix Match Link Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3
DA: 11001000 00010111 00011000 10101010
Examples
DA: 11001000 00010111 00010110 10100001 interface 0
interface 1
But not interface 2, the 3rd entry is also a match, but shorter!
CSci4211: Weekly Summary
126
Announcements & Reminders (Oct 31)• Homework Assignment #2 posted
Due due Friday Nov 22 11:59pm • 7 big problems + 1 bonus problem
• Project #2 : due Monday 11:59pm • if you have troubles w/ the project, ask TAs for help!
• Re-scheduling Thursday Dec 12’s optional lecture
• Dec 12 is “study/reading” day, can’t have class!• Reschedule to either Mon (Dec 9, preferred), Tue (Dec
10) or Wed (Dec 11) at the same time (6:30pm to 9pm)
• the lecture will be in Mech Eng. Building• topics of lecture: catch-up, wrap up & summary, final
review, Q&A, etc. • set up a doodle poll, please let us which day works
best
CSci4211: Weekly Summary
127
Take Home Quiz 1 Stats & Other Tidbits
• Take-Home Quiz I: graded (rather leniently)!• statistics: Max. 100, Median 93, Mean 88.5, Min. 45.5
• Please feel free to talk to us if you have questions, especially if you didn’t do well
• We’ll contact the students who did below 60, also reach out to students who are below 70.
• please check “Important Dates” for upcoming deadlines!
CSci4211: Weekly Summary
128
What We Learned Last Time (Oct 24)• Review IP addressing & datagram forwarding
• network prefix, dest-based forwarding, longest prefix matching
• Virtual Circuit• connection-oriented network service
• between hosts (or ingress/egress routers)• need to connect set-up (“signaling”) before any data can
be transmitted• connection set-up (signaling) process:
• given a route/path, select (locally unique, outgoing) VCI, & set up VCI translation table at each router
• data forwarding: • based on VCI carried in packets, perform VCI translation
• router architecture: interconnect fabric, in/output processing • IP datagram format: TTL, datagram id, offset, flags, …• MTU & IP fragmentation & reassembly
CSci4211: Weekly Summary
129
Virtual Circuit: Signaling Protocols
• used to setup, maintain teardown VC• used in ATM, frame-relay, X.25• used in part of today’s Internet: Multi-Protocol Label
Switching (MPLS) operated at “layer 2+1/2” (between data link layer and network layer) for “traffic engineering” purpose
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Initiate call 2. incoming call
3. Accept call4. Call connected5. Data flow begins 6. Receive data
CSci4211: Weekly Summary
130
During data packet forwarding phase, input VCI is used to look up the table, and is “swapped” w/ output VCI (VCI translation, or “label swapping”)
VCI translation table (aka “forwarding table”), built at call set-up phase
1
2
13
1
2 2
1
four “calls” going thru the router, each entry corresponding one call
green call
purple call
blue call
orange call
CSci4211: Weekly Summary
131
Virtual Circuit: Example
0
13
2
0
1 3
2
0
13
2
511
4
7
Router 3
Host B
Router 2
Host A
Router 1
Router 4
“call” from host A to host B along path: host A router 1 router 2 router 3 host B
• each router along path maintains an entry for the call in its VCI translation table
• the entries piece together a “logical connection” for the call
• Exercise: write down the VCI translation table entry for the call at each router
CSci4211: Network Layer: Part I
132
IP Datagram Format
ver length
32 bits
data (variable length,typically a TCP
or UDP segment)
16-bit identifier
Internet checksum
time tolive
32 bit source IP address
IP protocol versionnumber
header length (bytes)
max numberremaining hops
(decremented at each router)
forfragmentation/reassembly
total datagramlength (bytes)
upper layer protocolto deliver payload to
head.len
type ofservice
“type” of data flgs fragment offset
upper layer
32 bit destination IP address
Options (if any) E.g. timestamp,record routetaken, specifylist of routers to visit.
how much overhead with TCP?
• 20 bytes of TCP• 20 bytes of IP• = 40 bytes +
app layer overhead
CSci4211: Network Layer: Part I
133
IP Fragmentation and Reassembly: Exp
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
One large datagram becomesseveral smaller datagrams
Example• 4000 byte datagram• MTU = 1500 bytes
• offset in the second fragment:
185x8=1480 (why not 1500 bytes =length?)• offset in the third
fragment: 370x8=2960
Except for last fragment, IP fragment payload size (i.e., excluding IP header) must be multiple of 8!
CSci4211: Weekly Summary
134
Announcements & Reminders (Nov 7)• Project #2: due this past Wednesday 11:59pm • But if you haven’t finished it yet, please continue
working on it & submit ASAP
• Please start working on your homework assignment #2
• Project # 3 description posted on the class website
• Please take a look at it, and TAs will discuss the project in more details on Nov 14’s class
• Re-scheduling Thursday Dec 12’s optional lecture
• please answer the Doodle poll if u haven’t done it yet• based on current poll, mostly likely will be held on Mon
Dec 6 at the same time (6:30pm to 9pm)• may hold another one on Tue, or video-tape the lecture?
CSci4211: Weekly Summary
135
What We Learned Last Time (Oct 31)• ICMP; briefly, NAT & IPv6• Network Layer Routing
• basic issues: exchange routing info & compute routes• Two Basic (Distributed) Routing Algorithms
• Link State vs. Distance Vector• How does Link State (LS) work?• How does Distance Vector (DV) work?
• Today:• Issue with DV: county-to-infinity & possible hacks• Routing in Internet
• Intra-domain routing protocols: RIP, OSPF • Inter-domain routing protocol: BGP
• Data Link Layer:• MAC address & relation w/ IP: ARP• local area networks & bridging/switching
algorithm
CSci4211: Network Layer: Part II
136
Link State Algorithm
• Basic idea: Distribute to all routers– Topology of the network
• Cost of each link in the network
• Each router independently computes optimal paths– From itself to every destination– Routes are guaranteed to be loop free if
• Each router sees the same cost for each link• Uses the same algorithm to compute the best
path
CSci4211: Network Layer: Part II
137
Topology Dissemination
• Each router creates a set of link state packets (LSPs)– Describing its links to neighbors– LSP contains
• Router id, neighbor’s id, and cost to its neighbor
• Copies of LSPs are distributed to all routers– Using controlled flooding
• Each router maintains a topology database– Database containing all LSPs
CSci4211: Network Layer: Part II
138
A
ED
CB
F
2
2
13
1
1
2
53
5
Topology Database: Example
link state database
CSci4211: Network Layer: Part II
139
Constructing Routing Table:Dijkstra’s Algorithm
• Given the network topology– How to compute shortest path to each destination?
• Some notation– X: source node– N: set of nodes to which shortest paths are known so
far• N is initially empty
– D(V): cost of known shortest path from source X– C(U,V): cost of link U to V
• C(U,V) = if not neighbors
CSci4211: Network Layer: Part II 140
Algorithm (at Node X)
• Initialization– N = {X}– For all nodes V
• If V adjacent to X, D(V) = C(X,V) else D(V) =
• Loop– Find U not in N such that D(U) is smallest– Add U into set N– Update D(V) for all V not in N
• D(V) = min{D(V), D(U) + C(U,V)}– Until all nodes in N
CSci4211: Network Layer: Part II 141
Dijkstra’s Algorithm: Example
Step012345
start NA
ADADE
ADEBADEBC
ADEBCF
D(B),p(B)2,A2,A2,A
D(C),p(C)5,A4,D3,E3,E
D(D),p(D)1,A
D(E),p(E)infinity
2,D
D(F),p(F)infinityinfinity
4,E4,E4,E
A
ED
CB
F
2
2
13
1
1
2
53
5
CSci4211: Network Layer: Part II
142
A
ED
CB
F
2
2
13
1
1
2
5
3
5
Routing Table Computation
dest next
B BC DD DE DF D
CSci4211: Network Layer: Part II
143
Distance Vector Routing
• A router tells neighbors its distance to every router– Communication between neighbors only
• Based on Bellman-Ford algorithm– Computes “shortest paths”
• Each router maintains a distance table– A row for each possible destination– A column for each neighbor
• DX(Y,Z) : distance from X to Y via Z• Exchanges distance vector with neighbors
– Distance vector: current least cost to each destination
CSci4211: Network Layer: Part II
144
Distance Table: Example
A
E D
CB7
8
1
2
1
2
D ()
A
B
C
D
A
1
7
6
4
B
14
8
9
11
D
5
5
4
2
Ecost to destination via
des
tin
atio
n
CSci4211: Network Layer: Part II
145
Distance Vector Routing Algorithm
iterative:• continues until no
nodes exchange info.• self-terminating: no
“signal” to stop
asynchronous:• nodes need not
exchange info/iterate in lock step!
distributed:• each node talks only
with directly-attached neighbors
Distance Table data structure
• each node has its own• row for each possible destination• column for each directly-attached
neighbor to node• example: in node X, for dest. Y via
neighbor Z:
D (Y,Z)X
distance from X toY, via Z as next hop
c(X,Z) + min {D (Y,w)}Z
w
=
=
CSci4211: Network Layer: Part II 146
Distance Vector Routing: Overview
Iterative, asynchronous: each iteration caused by:
• local link cost change • message from neighbor:
its least cost path change from neighbor
Distributed:• each node notifies
neighbors only when its least cost path to any destination changes– neighbors then notify
their neighbors if necessary
wait for (change in local link cost or msg from neighbor)
recompute distance table
if least cost path to any
dest has changed, notify neighbors
Each node:
CSci4211: Network Layer: Part II
147
Distance Vector Algorithm: Example
X Z12
7
Y
D (Y,Z)X
c(X,Z) + min {D (Y,w)}w=
= 7+1 = 8
Z
D (Z,Y)X
c(X,Y) + min {D (Z,w)}w=
= 2+1 = 3
Y
CSci4211: Network Layer: Part II 148
Distance Vector Algorithm: Example
X Z12
7
Y
CSci4211: Weekly Summary
149
Announcement & Reminder (Nov 21)• Project #3 due tomorrow (Friday)
• Hw #2 due: Monday Nov 25 11:59pm
• Take-Home Quiz II: email to you Mon evening Nov 25, due Mon Dec 2
• similar to (& easier than) Hw #2
• Extra office hours: Tuesday Nov 26: 2:30-4pm
Two Optional Lectures (Mon Dec 9 & Tue Dec 10)
• 6:30pm - 9pm; Venue: TBA (ME 108?)
CSci4211: Weekly Summary
150
What We Learned Last Times (Nov 7 & 14)• Wrap up basic routing algorithms
• count-to-infinity problem in DV• Routing in the Internet
• two-level hierarchy; notion of AS• intra-domain: RIP, OSPF, IS-IS • inter-domain: BGP, path-vector, policy-based
• AS relationship: provider-customer; peering• routing policies: e.g., prefer customer routes
• Data Link Layer• basic functions: framing, access control, etc.
• MAC addresses and ARP• What is MAC address? How it differs from IP address• Why do we need ARP? How does ARP work?• TAs on Nov 14: layer-2 switches & layer-2
forwarding• switch “self-learning” algorithm
CSci4211: Weekly Summary
151
CSci4211: Weekly Summary
152
CSci4211: Weekly Summary
153
Announcement & Reminder (Dec 5)• Project #4 due tomorrow (Friday)
• Optional Lectures (Mon Dec 9 & Tue Dec 10)• 6:30pm - 9pm; Venue: Mech Eng. Bld: ME 18 • same class to accommodate your schedule• wrap up, review, & Q&A, etc.
• Extra office hours: • Tuesday Dec 17: 2:30-4:00pm• Thursday Dec 19: 4:00-6:00pm
• Final Exam: • Thursday Dec 19: 6:30pm to 8:30pm, venue:
here!• similar to Quiz II, but comprehensive (cover
everything)• open-book, open-note, open-Internet
CSci4211: Weekly Summary
154
CSci4211: Weekly Summary
155
CSci4211: Weekly Summary
156
CSci4211: Weekly Summary
157
CSci4211: Weekly Summary
158
What We Learned Last Time (Nov 21)• Review & Finish up (layer-2) switches/bridges
• how does a switch build its switching table? -- self-learning algo: use src MAC; forward using dst MAC• loops in topology and “broadcast storm” -- spanning tree algorithm: rooted at a particular switch
• Media Access Control: shared media -- issues and difficulties ?
• Taxonomy of MAC protocols• Random access control:
• ALOHA and Slotted ALOHA: collision? efficiency?• CSMA: listen before talking:
-- non-persistent vs. p-persistent• CSMA/CD: collision detection – listen while talking
-- maximum time to detect collision?• Ethernet and its Evolution: 10-base, 100-base, Gigabit,
… -- why minimum frame size constraint?• “Taking Turns” Protocols: example – Token Ring• Protocol Efficiency: Heavy vs. light loads? Other Issues?
CSci4211: Weekly Summary
159
Questions?
CSci4211: Key Notes 160
A Simplified Illustration of Internet
top related