56
CSci4211: Weekly Summary 1 What We Learned Last Time (Sept 9) What is a Computer Network/Internet? services • components and their functions Compare & Contrast: Telephone Networks & Postal Service Packet Switching vs. Circuit Switching • statistical multiplexing compare and contrast: TDM, FDM • Fundamental Issues and Problems in Networking Layered Architecture and Protocol

CSci4211: Weekly Summary1 What We Learned Last Time (Sept 9) What is a Computer Network/Internet? services components and their functions Compare & Contrast:

Embed Size (px)

Citation preview

CSci4211: Weekly Summary

1

What We Learned Last Time (Sept 9)

• What is a Computer Network/Internet? • services• components and their functions

Compare & Contrast: Telephone Networks & Postal Service• Packet Switching vs. Circuit Switching

• statistical multiplexing• compare and contrast: TDM, FDM

• Fundamental Issues and Problems in Networking• Layered Architecture and Protocol

CSci4211: Key Notes 2

Summary of Introduction 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

Packet switching vs. circuit switching: packets, packet switching & statistical multiplexing delay, losses and congestion vs. call blocking

Key functions: naming, addressing, routing & forwarding Networks are distributed & complex systems!

Architecture: layering & hourglass different technologies, “boxes” (routers, switches), & apps Protocols and Interfaces (API)

What may go wrong? bit errors, packet losses,, node failures, software bugs, app crashes.

….. and Attacks !!! What today’s Internet looks like? economics & policies

CSci4211: Key Notes 3

Stuff We Didn’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 Delay, Loss, and Throughput

various delays: transmission delay, propagation delay, processing delay, queuing delay, ..

CSci4211: Key Notes 4

A Simplified Illustration of Internet

CSci4211: Weekly Summary

5

Announcements (Sep 23)

• Project #1: out today, and Due Friday Oct 8  (11:59 pm).

Please start working on it as soon as possible!

• Written Homework Assignment #1 will be posted by Sep 30, due Thu Oct 14 (6:30pm)

• P.S.: Prof. Zhang will be on a oversea trip from Sep 25-Oct 12. No office hours during this period (may still have intermittent Internet access).

CSci4211: Key Notes 6

What We Learned Last Time (Sept 16)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

Examples of applications/application protocols world wide web and HTTP: transaction-oriented app protocol email and SMTP (& POP, IMAP): session-based app protocol

Domain Name System (DNS)

download“wireshark” software!

CSci4211: Key Notes 7

Highlight of Today’s Lecture (Sept 23)

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?• especially, if the other party is behind NAT

Unstructured P2P Application Examples: BitTorrent Gaaza, Skype, …

Distributed Hashing Tables (DHT) Java Socket Programming Project #1 Overview

CSci4211: Weekly Summary

8

Announcement (Sep 16)

• Please sign up to the class google group!

• Advanced Notice: Programming Project # 1 will be posted next week!

• Please start reading about (Java) socket programming in the textbook, and try the examples!

CSci4211: Weekly Summary

9

What We Learned Last Time (Sept 12)

• Application Layer• application requirements & transport services• application programming paradigms

• client-server vs. peer to peer• Case Study 1: Web & HTTP

• web client vs. web server (TCP, port 80)• HTTP: request & reply

• Case Study 2: Email• SMTP: “interactive” • Mail Access Protocols: POP, IMAP

• DNS: why do we need DNS?• DNS server architecture & query process

CSci4211: Weekly Summary

10

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

11

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

CSci4211: Weekly Summary

12

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

13

Announcement & Reminder (Oct 3)

• Homework Assignment #2: Due Oct 17• check the class website

Reminder:• Start working on your project #1, if you haven’t yet!

CSci4211: Weekly Summary

14

What We Learned Last Time (Sept 19 & Sept 26)

• 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)

• simply reliable data transfer protocol • connection set-up: 3-way handshake

• BSD Socket Programming• create socket, bind socket, close socket• connect, listen accept• read/write, sendto/recvfrom, …

CSci4211: Weekly Summary

15

Reminders (Oct 10)

• Homework Assignment #2: Due Oct 17• Project #1: Due Oct 17

• Mid-Term: Oct 24 (in two weeks !!!)• Start reviewing the material you have learned so far:

•basic network concepts•application layer•transport layer

CSci4211: Weekly Summary

16

What We Learned Last Time (Oct 3)

• TCP Connection Management•Review TCP 3-way handshake connection setup• Closing a connection: key issues and how TCP does it

• More efficient reliable data transfer protocols• What’s the problem with Stop&Wait protocol?• 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

• round trip time estimation and TCP timeoutInterval

CSci4211: Weekly Summary

17

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

18

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

CSci4211: Weekly Summary

19

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 window

Receiver:• 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

20

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

21

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

22

GBN in Action

CSci4211: Weekly Summary

23

Selective Repeat: Sliding Windows

CSci4211: Weekly Summary

24

Selective Repeat in Action

CSci4211: Weekly Summary

25

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

26

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

27

Reminders (Oct 17)

• Homework Assignment #2: Due today midnight• Project #1: Due today midnight

• Mid-Term: Oct 24 (7:30 – 9pm next Thursday !!!)

• 5 “big questions”• cover the material up to Oct 10 (inclusive)

•basic network concepts•application layer (exclude BSD/Java socket APL)

•transport layer •network layer (IP addressing, VC vs. Datagram)

CSci4211: Weekly Summary

28

What We Learned Last Time (Oct 10)

• Finishing up TCP and Transport Layer • 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

29

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

30

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

31

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

32

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

33

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

34

What We Learned Last Time (Oct 10) …

•Network Layer• basic functions: addressing, routing & forwarding• IP addressing:

• 32 bits, dot notation• two-level hierarchy: network part & host part

• how to determine network part?• “classful” addressing scheme• “classless” addressing scheme: CIDR

• Network Service Models• Virtual Circuits: how it works?

• VC set-up & VCI translation table• data forwarding

• Datagram: how it works?

CSci4211: Weekly Summary

35

Routing & Forwarding:Logical View of a Router

A

ED

CB

F

22

13

1

1

2

53

5

CSci4211: Weekly Summary

36

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

37

“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

38

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

39

Virtual Circuit vs. Datagram• 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: – 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

40

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: Weekly Summary

41

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

42

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

43

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: Weekly Summary

44

CSci4211: Weekly Summary

45

Midterm & Other Tidbits (Oct 28)

• Midterm Exams:• graded• statistics:

• Max. 90, Median 87, Mean 73, Min. 40• talk to us if you have questions, especially if you didn’t do well

• Project 2 extended to Wed Nov 3, 11:59pm

• please check “Important Dates” for upcoming deadlines!

CSci4211: Weekly Summary

46

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

47

Stop & Wait: Performance AnalysisExample:

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

48

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

49

Questions?

CSci4211: Weekly Summary

50

Today’s Topics (Oct 28)• IP Addressing and IP datagram service model:

• What’s an IP address?• IP addressing scheme:

• class-based vs. classless (CIDR) •How do you get one? Manually config., DHCP• How does an ISP get their address blocks?

• IP datagram forwarding: host vs. routers • longest prefix matching

• IP datagram format, IP fragmentation and re-assembly; ICMP

• Router architecture: a quick overview• If time permits, overview of routing

CSci4211: Weekly Summary

51

CSci4211: Weekly Summary

52

Announcement & Reminder (Nov 21)

• Hw #3 due today at midnight• Hw #4 is posted on class website

• Project II “milestone” report (optional)• email TA ([email protected]) what you have done, and what still need to be done; issues & problems you are facing, etc.

CSci4211: Weekly Summary

53

What We Learned Last Time (Oct 17)

• Network Layer Routing• basic issues

• Two Basic Routing Algorithms• Link State vs. Distance Vector• How does LS work?

•Today:•DV•Routing in Internet

•RIP, OSPF and BGP

CSci4211: Weekly Summary

54

What We Learned Last Time (Nov 14)

• 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?

• Media Access Control •Shared media: issues and difficulties•Taxonomy of MAC protocols• Random access control:

•ALOHA and Slotted ALOHA

CSci4211: Weekly Summary

55

Announcement & Reminder (Dec 5)

• Project II due mid-night today•sign up for demo slots if haven’t done so

• Hw #4 due mid-night next Tuesday (Dec 10)

• Next Thursday’s class is last class of semester!

• We’ll finish up whatever leftover today• Review material covered in entire course, focusing on material after midterm• Go over a sample final exam (will posted on web)

CSci4211: Weekly Summary

56

What We Learned Last Time (Nov 21)

• Random Access Control:•CSMA: nonpersistent vs. p-persistent• CSMA/CD•What are they? How do they work?

• Adaptive Controlled Access:• token passing vs. polling

• Ethernet•MAC: 1-persistent CSMA/CD, binary random backoff• collision domain, bit-time and min. frame size • 10BaseT, 100 BaseT (Fast Ethernet), Gigabit Ethernet

• Bridge: what does a bridge do?• transparent (“plug & play”)• bridge forwarding table: self-learning