+ All Categories
Home > Documents > 6/5/05CS118/Spring051 About the Final Exam r Saturday June 11 3:00-6:00PM, 2444 BH r Material to be...

6/5/05CS118/Spring051 About the Final Exam r Saturday June 11 3:00-6:00PM, 2444 BH r Material to be...

Date post: 22-Dec-2015
Category:
View: 214 times
Download: 1 times
Share this document with a friend
Popular Tags:
37
6/5/05 CS118/Spring05 1 About the Final Exam Saturday June 11 3:00-6:00PM, 2444 BH Material to be covered Chapters 2 & 3: 20-30% Chapter 4 (4.4-4.8), Chapter 5 (5.1-5.7), Chapter 6 (6.3, 6.5): 70-80% Closed book, closed notes You can bring 2 (8x11) "cheat sheets" into the final exam (double-side OK) New office hour 10:00AM-1:00PM Saturday 6/11 No office hour Wednesday 6/8
Transcript

6/5/05 CS118/Spring051

About the Final Exam

Saturday June 11 3:00-6:00PM, 2444 BH Material to be covered

Chapters 2 & 3: 20-30% Chapter 4 (4.4-4.8), Chapter 5 (5.1-5.7), Chapter 6 (6.3, 6.5):

70-80%

Closed book, closed notes You can bring 2 (8x11) "cheat sheets" into the final

exam (double-side OK) New office hour 10:00AM-1:00PM Saturday 6/11

No office hour Wednesday 6/8

6/5/05 CS118/Spring052

A Day in the Life of an HTTP Query

1.HTTP

Brower application

Socket interface3.TCP

4.IP

5.Ethernet

2.DNS query

SwitchIP routerRunning routing protocol

IPEthernet

Socket interface

Web server application

HTTP

demultiplexing

multiplexing

Client/server paradigm

TCP

Transport protocols

6/5/05 CS118/Spring053

A Bottom-up Roadmap Physical layer: know how to calculate the delay of sending

packets from one node to another Transmission rate (bandwidth) Transmission delay Propagation delay

Link layer: move data between two directly connected nodes Error checking schemes: parity, checksum, CRC Framing, byte stuffing Multi-access protocols: Aloha, Ethernet (CSMA/CD), 802.11

(CSMA/CA, RTS-CTS) Switch self-learning scheme

Network layer IP address structure (subnet, CIDR) Routing: distance vector, link state; broadcast, multicast, IGMP IP header

6/5/05 CS118/Spring054

On top of network layer

Transport layerUDP, TCP: header formatTCP: connection set-up & tear-down, congestion

control, retransmission timer setting reliable data delivery

• Stop-and-go

• Go-back-N

• Selective-repeat

Application layer protocols

6/5/05 CS118/Spring055

Switch 2Switch 1

Packet(carriesdestinationaddress)

Efficient resourcesharingFlexible delivery

Computer Networking: the overall picture What is packet switching?

Cut data into chunks, sent in a "store-and-forward" way statistical multiplexing queueing delay, potential losses

why packet switching?

What’s in a packet: header: contains all the information needed for data delivery

Why layered network protocol architecture? Divide and conquer

header data

6/5/05 CS118/Spring056

Ethernet frame

IP packet

TCP packet

header tail

IP hdr

TCP hdr

DATA

DATA

DATA

DATA

Layered protocol implementationA protocol defines: the format of message exchanged between

peer entities the actions taken on receipt of the message

What’s in the header: all the information,and only the information that’s needed for the protocol’s functionality

6/5/05 CS118/Spring057

Multi-access protocol

Aloha/Slotted AlohaQ: for a network with 3 nodes, what is the probability

that a given node sends successfully without collision?

Ethernet1-persistent CSMA/CD

Q: Why need collision detection?Collision resolution: how exponential backup works

802.11 wireless LANCSMA/CARTS-CTS

6/5/05 CS118/Spring058

t2t3

Time saved from collection detection

Ethernet: Why Collision Detection

6/5/05 CS118/Spring059

Wireless LAN: Collision Avoidance802.11 sender1 if sense channel idle for DIFS then

transmit entire data frame (no CD)2 if sense channel busy: start random

backoff timer3 timer counts down while channel idle4 when timer expires: transmit entire frame

- if no ACK, increase random backoff interval, go to step 3

802.11 receiverif frame received OK - return ACK after SIFSQ: How does waiting for a random time

period help collision avoidance?

sender receiver

DIFS

data

SIFS

ACK

DIFS: distributed inter-frame spacingSIFS: short inter-frame spacing

6/5/05 CS118/Spring0510

MAC Address and ARP

Compare MAC address with IP address The detailed operations of ARP How many steps in sending a packet from one host to

another located on a different network? Find out whether destination on the same network ARP if needed Encapsulate IP packet in a link layer protocol and send to next

hop

How to connect multiple Ethernets Compare hubs, switches, and routers Switch self-learning algorithm

6/5/05 CS118/Spring0511

Switch Learning Example

B1

B3

B2

B4

A

D

C

Q: Assuming all the switches' forwarding tables are empty, show the forwarding tables for switches B1-B4 after the following transmissions:

1. A sends to C

2. C sends to A

3. D sends to CSolution:

•When A sends to C, all the switches see the packet and learn where A is.

•When C sends to A, the packet is routed directly to A, and B4 does not learn where C is.

•When D sends to C, the packet is routed by B2 towards B3, and B1 does not learn where D is.

6/5/05 CS118/Spring0512

transport(end-to-end)

Ethernet wireless FDDI dialup ATM

IP

TCP UDP RDP

internet layer

Various application protocols

The picture of the world according to IP

SCTP

Various network technologies

6/5/05 CS118/Spring0513

all hosts connected to physical networks (subnet)all subnets interconnected by IP routers

receive and forward packets between subnets at subnet level a router sends/received data in exactly

the same way as a host IP assigns globally unique addresses to all

reachable interfaces (connecting to either hosts or routers)

datagram delivery between these interfacesrouters run routing protocols to figure out the next

hop to forward each IP packet towards its destination

The picture of the world according to IP

6/5/05 CS118/Spring0514

IP Packet Header

vers. # HLen type-of-service total length

identification fragment offset

time-to-live protocol IP header checksum

source address

destination address

options (variable length) padding

data

flags

0 4 8 16 31

Basic header

What is the purpose for each header field?For example, why do we need TTL field?

6/5/05 CS118/Spring0515

IP and Below

IP delivers packets from host to host, possibly through a chain of IP routersAn IP address uniquely identifies an attachment

interfaceeach IP router looks up the forwarding table to

determine the next subnet to forward the packet tophysical networks do the real work of getting

packets from one IP node to the nextpackets are encapsulated and de-capsulated when

crossing physical network boundariesTo map IP address to network MAC address:

ARP

6/5/05 CS118/Spring0516

Interconnection by encapsulation IP packets are wrapped in a network’s protocol to travel

through that network A router un-wraps the packet to see its IP destination

address on the same network: send to destination directly on a diff. network: send to next hop router

Router-1

ETH FDDI

IPIP

ETH

R2

FDDI PPP

IP

H1

data IP Eth data IP FDDI

data IP data IP data IP

Q: a packet traverses 4 routers from source to destination, how many time does it get encapsulated and de-capsulated along the way?

6/5/05 CS118/Spring0517

Identifier: 8FB3 DFMF fragment offset (13 bits)

IP packet fragmentation detailsall fragments of the same packet carry the same identifierall fragments except the last one have the “MF” bit setfragment offset points to the first byte of the fragmentExample:

1st fragment: identifier=8FB3; MF=1; offset=02nd fragment: identifier=8FB3; MF=1; offset=643rd fragment: identifier=8FB3; MF=0; offset=128

data=1300B IP header

data frag-3 IP Hd data frag-2 IP Hd data frag-1 IP Hd(512B)(512B)(276B)

Rest of IP header

6/5/05 CS118/Spring0518

IP packet reassembly at destination hostuse identifier and offset to put the pieces back

together the offset plus the packet length tells whether there are

holes missing in the middle the last fragment is indicated by MF=0

Destinationhost

Ver TOS 532

8FB3 001 0

rest of IP header

data

Ver TOS 532

8FB3 001 64

rest of IP header

data

276

8FB3 000 128Ver TOS

rest of IP header

data

• Upon receiving the first fragment of an IP packet, destination host sets a reassembly timer• when the timer goes off and the destination host still has not received all the pieces, it drops all the received pieces.

6/5/05 CS118/Spring0519

IP address structure

4 bytesHierarchical ! (i.e. not flat, as MAC addresses)

network IDhost ID

What is the boundary between these 2 parts:Classful address: classes A, B, CSubnettingClassless Inter-Domain Routing (CIDR)

6/5/05 CS118/Spring0520

Network-ID host-ID 4 byte

11111111111111111111110000000000Network ID

Subnetting

subnetting: Add another (hidden) level to address hierarchySubnet is known only at the local siteUse part of the original host ID portion as netID

Subnet mask: defines portion of the address considered as “network ID” by the local site

6/5/05 CS118/Spring0521

CIDR: Classless InterDomain Routing

assign network addresses by blocks of contiguous IP addresses, in a form of

<IP address, mask>mask identifies block size, must be power of 2example: SmartDesign Inc. got 4 x 2^8 address blocks 192.4.16.0192.4.19.255,

<192.4.16.0, 255.255.252.0>, or 192.4.16/2211000000000001000001000000000000 11000000000001000001001111111111

192 4 16 0 192 4 19 255

11111111111111111111110000000000

255 255 252 022 bits of prefix

6/5/05 CS118/Spring0522

CIDR and subnetting example

BA

Network# next-hop

192.4.16.0 B192.4.0.0 M

Look up IP addr. 192.4.18.15

C

Network# mask next-hop

192.4.18 255.255.255.128 C …… ………..

192.4.18.15

Global Internet SmartDesign

192.4.18.0/25

11000000000001000001001000001111

M

11000000000001000001000000000000

11000000000001000000000000000000192 . 4 .

11111111111111111111111110000000

11000000000001000001001000001111192 . 4 . 18

6/5/05 CS118/Spring0523

WAN 78.0.0.0router

A BC

data IP Eth

Following an IP packet from source to dest.Source host A first uses subnet mask M to figure out whether

dest. host is on the same network 1. Dest. = host B: find B's MAC address, send data2. dest. = host C, A sends packet to its default router

the router strips off Ethernet header, consult its IP forwarding table to find next hop

3. Dest. = D:

data IP

data IP WAN223.240.129.0R2

D data IP

data IP

6/5/05 CS118/Spring0524

IPv6

What header fields are available in both IPv4 and IPv6? What are the new fields in IPv6 header? Why do we

need them? Comparison between IPv4 and IPv6Q: Does IPv6 support fragmentation? If not, how does

IPv6 handle the case of small-MTU network?

Transition from IPv4 to IPv6 how does tunneling work?

6/5/05 CS118/Spring0525

IPv6 header format

Destination Address (16 bytes)

Version Priority Flow Label

Payload Length Next Header Hop Limit

Source Address (16 bytes, 128 bits)

Version Hdr Len Total Length

Identification Fragment Offset

Prec TOS

Time to Live Protocol Header Checksum

Flags

Source Address

Destination Address

PaddingOptions

 32 bits 

IPv4 header

6/5/05 CS118/Spring0526

Transition From IPv4 To IPv6 Not all routers can be upgraded simultaneous to allow the Internet operate with mixed IPv4 and IPv6

routers : tunnelingA B E F

IPv6 IPv6 IPv6 IPv6

tunnelLogical view:

Physical view:A B E F

IPv6 IPv6 IPv6 IPv6

C D

IPv4 IPv4

Flow: XSrc: ADest: F

data

Flow: XSrc: ADest: F

data

Flow: XSrc: ADest: F

data

Src:BDest: E

Flow: XSrc: ADest: F

data

Src:BDest: E

A-to-B:IPv6

E-to-F:IPv6

B-to-C:IPv6 inside

IPv4

B-to-C:IPv6 inside

IPv4

6/5/05 CS118/Spring0527

Broadcast and Multicasting Broadcast

By building a spanning tree By reverse path forwarding

IP multicast service model each group identified by an IP mcast address members can be anywhere members may join and leave any time

multicast routing protocols Center-based, shared multicast tree Distance-Vector Multicast Routing (DVMRP)

• reverse path broadcast: only broadcast over output interfaces if the input interface is on the shortest path to the source S

• pruning and grafting

Q: after sending a pruning message, why does the router need to keep the pruning state?

6/5/05 CS118/Spring0528

IGMP A query router on each link querier periodically polls the link on receipt of query message, a host sets a random timer for

each mcast group it belongs to when timer expires, send a membership report to group G others in G hear the report and stop the timers joining: send reports immediately leaving: send a leave msg only if the host answered the last

membership query, and querier router sends group-specific queries again

Q: Why does the host use a random timer in IGMP?Q: Does the router know how many receiving hosts for each multicast group on its local Ethernet?Q: When the last receiving host leaves the group, but its leave message is lost, what happens?

6/5/05 CS118/Spring0529

ON TCP

How does TCP achieve reliable data delivery?What are the fundamental mechanisms?

How does TCP perform flow control?How does TCP perform congestion control?How does TCP estimate its RTT and set the

retransmission timeout (RTO)?

6/5/05 CS118/Spring0530

u a p r s Fr c s s y ig k h t n n

source port destination port

Data sequence number

acknowledgment number

Hlen unused window size

checksum urgent pointer

Options (viable length)

0 16 31

TCP header format

data

IP header

6/5/05 CS118/Spring0531

source port # destination port#

length checksum

data ......

0 31

"pseudo header" in UCP and TCPUDP header Length: # of bytes (including both header & data) checksum: computed over

the pseudo header, and UDP datagram (including both header and data) if the value is 0: no checksum

source IP address

destination IP address

zero protocol TCP length

TCP pseudo header

source IP address

destination IP address

zero protocol UDP length

UDP pseudo header

6/5/05 CS118/Spring0532

More on pseudo headers

addresses & protocol: copied from IP headerLength

UDP: already covered in the UDP headerTCP: can be calculated from the IP total length

pseudo header is not carried in the datagram, nor counted in length field

why pseudo header: UDP/TCP's self-protection against mis-delivered IP packets

6/5/05 CS118/Spring0533

client server

open request(x) Passive open

ack(x+1) + request(y)

ack(y+1)(now in estab. state) enter estab. state

TCP connection: open and closeOpen: the initial seq# is randomly chosen

Done, delete conn. state

I-finished(M)

I-finished(N)

ACK (M+1)

ack(N+1), wait for 2MSL before deleting conn. state

Close:

6/5/05 CS118/Spring0534

TCP Retransmission Timer SRTT = EstimatedRTT, rttvar = DevRTT When opening a new TCP connection:

EstimatedRTT = DevRTT = 3 sec Upon getting the first RTT sample:

EstimatedRTT = SampleRTT, DevRTT = EstimatedRTT/2 Upon getting next SampleRTT:

difference = SampleRTT - EstimatedRTT EstimatedRTT = (1-) x EstimatedRTT + x SampleRTT

= EstimatedRTT + x difference DevRTT = (1-) x DevRTT + x |difference|

= DevRTT + (|difference| - DevRTT) Typically: = 1/8, = 1/4

TimeoutInterval (RTO) = EstimatedRTT + 4 x DevRTT If timeout: RTO = 2 x RTO

6/5/05 CS118/Spring0535

TCP Congestion Control

Basic idea: learn from observations when congwin < threshold, increase congwin exponentially

when congwin ≥ threshold, increase congwin linearly

if packet lost, have gone too far threshold = congwin / 2 If 3 dup. ACKs: network capable of delivering some

packets, congwin cut in half If timeout: slow-start again (congwin = 1 mss)

6/5/05 CS118/Spring0536

TCP Slow-Start & Congestion Avoidanceinitialize:

Congwin = 1 MSSthreshold = RcvWindow

if (CongWin < threshold){ for every segment ACKed Congwin++} until (loss event)

/* slowstart is over */ { for every w segments ACKed: Congwin++} Until (loss event)

/* loss detected */threshold = Congwin/2If (3 dup. ACKs) Congwin = thresholdElse Congwin = 1 MSS

one segment

RTT

time

two segments

four segments

6/5/05 CS118/Spring0537

Application Protocols

HTTPPersistent vs. non-persistent HTTPParallel HTTP sessions

DNS: providing name to IP address translation serviceGenerally speaking, there is no relation between DNS

domains and IP address spaceFTP: uses separate TCP connections for control

exchange and file transferSMTP


Recommended