Top Banner
CcompSci 356 Computer Network Architecture Lecture 25: Final review Xiaowei Yang [email protected]
49

CcompSci356 Computer Network Architecture Lecture 25 ...

Dec 04, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CcompSci356 Computer Network Architecture Lecture 25 ...

CcompSci 356 Computer Network Architecture

Lecture 25: Final review

Xiaowei [email protected]

Page 2: CcompSci356 Computer Network Architecture Lecture 25 ...

What we have learned

• Key components of the Internet

• What happens when data is sent from one host to another

Page 3: CcompSci356 Computer Network Architecture Lecture 25 ...

What the Internet looks like

email WWW phone...

SMTP HTTP RTP...

TCP UDP…

IP

ethernet PPP…

CSMA async sonet...

copper fiber radio...

Ethernet

ATM

Framerelay

IP/SONET

Ethernet

Ethernet 802.X

Wireless

Host Host

Host

Host

Host

Host

Host

HostHost

Host

Host

Host

HostHost

Host

Tier 1 Tier 1

Tier 2

Tier 2

Tier 2

Tier 3

The Internet

BGP

RIP, OSFPDistance VectorLink-State

Ethernet, CSMA/CDBridges, Switches,Spanning Tree

Bandwidth x DelayTCP Performance

ModulationCodingFDMA, TDMA

IP Blocks, CIDR, SubnetsLongest Prefix Match,Fragmentation, MTU

Page 4: CcompSci356 Computer Network Architecture Lecture 25 ...

Functions/Concepts at different layers

Bandwidth, latency, throughput, delay-bandwidth product

Encoding, framing, error detection, reliabilitymedia sharing, switching

Forwarding, Routing, Addressing

Reliable transport, multiplexing

Application protocols vs Applications

Page 5: CcompSci356 Computer Network Architecture Lecture 25 ...

CPU

Network adapter

To network I/O bus

Cache

MemoryFrom network

Physical properties of a link

Page 6: CcompSci356 Computer Network Architecture Lecture 25 ...

Bandwidth

• Bandwidth of a link refers to the number of bits it can transmit in a unit time– A second of time as distance– Each bit as a pulse of width

• Fast link • Slow link

Page 7: CcompSci356 Computer Network Architecture Lecture 25 ...

Latency to transmit a packet

• Has four components– Link propagation delay– Transmission/serialization latency– Queuing delay– Processing delay (often ignored)

Page 8: CcompSci356 Computer Network Architecture Lecture 25 ...

Round trip time (RTT)

• Time to send a packet and receive an acknowledgement

Page 9: CcompSci356 Computer Network Architecture Lecture 25 ...

How to determine the “optimal” sliding window size

• Discuss midterm problem 3• What does “keep the pipe full” mean?

Page 10: CcompSci356 Computer Network Architecture Lecture 25 ...

Mechanisms at Different layers

• Link layer– Encoding• NRZ, NRZI, Manchester, 4B/5B

– Framing• Byte-oriented, bit-oriented, time-based • Bit stuffing

– Error detection• Parity, checkshum, CRC

– Reliability• FEC, sliding window

Page 11: CcompSci356 Computer Network Architecture Lecture 25 ...

Link layer continued

• Multi-access link– Ethernet• Collision Sense Multiple Access/Collision Detection

(CSMA/CD)

–WIFI• Carrier-sense multiple access with collision avoidance

(CSMA/CA)• Cannot send and receive at the same time• Must send when channel is idle• RTS/CTS

Page 12: CcompSci356 Computer Network Architecture Lecture 25 ...

Link layer continued

• Virtual circuit switching– ATM

• Datagram switching– Ethernet learning bridges• Spanning tree algorithm

• Source routing

Page 13: CcompSci356 Computer Network Architecture Lecture 25 ...

The network layer• The Internet Protocol• Classless Interdomain Routing (CIDR)– Addressing format– Subnet, network prefix

• Forwarding– Longest prefix matching

Page 14: CcompSci356 Computer Network Architecture Lecture 25 ...

The network layer continued

• Routing– Distance vector– Link state– BGP

• Auxiliary functions– ARP, ICMP, DHCP, NAT, IP Tunnel

• Multicast• QoS

Page 15: CcompSci356 Computer Network Architecture Lecture 25 ...

The transport layer

• UDP– Datagram, connectionless, multiplexing multiple

applications

• TCP– Reliable, byte stream

Page 16: CcompSci356 Computer Network Architecture Lecture 25 ...

TCP

• Connection establishment• Reliability– Sliding window– Loss recovery• Time out, duplicate acks, selective ACKs

• Flow control• Congestion control and avoidance

Page 17: CcompSci356 Computer Network Architecture Lecture 25 ...

TCP congestion control

1. Probing for the available bandwidth – slow start (cwnd < ssthresh)

2. Avoid overloading the network – congestion avoidance (cwnd >= ssthresh)

Page 18: CcompSci356 Computer Network Architecture Lecture 25 ...

Slow Start

• Initial value: Set cwnd = 1 MSS• Modern TCP implementation may set initial cwnd to 2

• When receiving an ACK, cwnd+= 1 MSS• If an ACK acknowledges two segments, cwnd is still

increased by only 1 segment.• Even if ACK acknowledges a segment that is smaller

than MSS bytes long, cwnd is increased by 1.• Question: how can you accelerate your TCP download?

Page 19: CcompSci356 Computer Network Architecture Lecture 25 ...

Congestion Avoidance

• If cwnd >= ssthresh then each time an ACK is received, increment cwnd as follows:

• cwnd += MSS * (MSS / cwnd) (cwnd measured in bytes)

• So cwnd is increased by one MSS only if all cwnd/MSS segments have been acknowledged.

Page 20: CcompSci356 Computer Network Architecture Lecture 25 ...

Slow Start

• Initial value: Set cwnd = 1 MSS• Modern TCP implementation may set initial cwnd to 2

• When receiving an ACK, cwnd+= 1 MSS• If an ACK acknowledges two segments, cwnd is still

increased by only 1 segment.• Even if ACK acknowledges a segment that is smaller

than MSS bytes long, cwnd is increased by 1.• Question: how can you accelerate your TCP download?

Page 21: CcompSci356 Computer Network Architecture Lecture 25 ...

Congestion Avoidance

• If cwnd >= ssthresh then each time an ACK is received, increment cwnd as follows:

• cwnd += MSS * (MSS / cwnd) (cwnd measured in bytes)

• So cwnd is increased by one MSS only if all cwnd/MSS segments have been acknowledged.

Page 22: CcompSci356 Computer Network Architecture Lecture 25 ...

22

TCP congestion control modeling

• Four sample types of controls• AIAD, AIMD, MIAD, MIMD

Page 23: CcompSci356 Computer Network Architecture Lecture 25 ...

23

Phase plot

x1

x2

Page 24: CcompSci356 Computer Network Architecture Lecture 25 ...

Application layer• Domain Name System (DNS)– Problem 5 of homework

• Socket interface

• Application protocols vs applications– Email

• Security primitives

Page 25: CcompSci356 Computer Network Architecture Lecture 25 ...

Figure out the DNS serverhierarchy

• dig +norecurse @a.root-servers.net NS www.cnn.com

Page 26: CcompSci356 Computer Network Architecture Lecture 25 ...

• https://ns1.com/articles/using-dig-trace• dig +trace www.cnn.com• dig +trace turner-tls.map.fastly.net.

Page 27: CcompSci356 Computer Network Architecture Lecture 25 ...

Other examples

• Sample final problem 4• Midterm problem 2

Page 28: CcompSci356 Computer Network Architecture Lecture 25 ...

Looking forward

• Graduate networking class– Datacenter networking– Future Internet architectures

Page 29: CcompSci356 Computer Network Architecture Lecture 25 ...

What to expect in the final

• Networking knowledge– Understanding

• Application of networking knowledge

Page 30: CcompSci356 Computer Network Architecture Lecture 25 ...

Course evaluation

• Please do it if you have not!

Page 31: CcompSci356 Computer Network Architecture Lecture 25 ...

An Example

Page 32: CcompSci356 Computer Network Architecture Lecture 25 ...

• A user on host argon.tcpip-lab.edu (�Argon�) makes web access to URL

http://neon. tcpip-lab.edu/index.html.

• What actually happens in the network?

A simple TCP/IP Example

argon.tcpip-lab.edu("Argon")

neon.tcpip-lab.edu("Neon")

Web request

Web page

Web client Web server

Page 33: CcompSci356 Computer Network Architecture Lecture 25 ...

HTTP Request and HTTP response

• Web server runs an HTTP server program• HTTP client Web browser runs an HTTP client

program• sends an HTTP request to HTTP server• HTTP server responds with HTTP response

HTTP client

Argon

HTTP server

Neon

HTTP requestHTTP response

Page 34: CcompSci356 Computer Network Architecture Lecture 25 ...

HTTP Request

GET /example.html HTTP/1.1Accept: image/gif, */*Accept-Language: en-usAccept-Encoding: gzip, deflateUser-Agent: Mozilla/4.0 Host: 192.168.123.144Connection: Keep-Alive

Page 35: CcompSci356 Computer Network Architecture Lecture 25 ...

HTTP Response

HTTP/1.1 200 OKDate: Sat, 25 May 2002 21:10:32 GMTServer: Apache/1.3.19 (Unix) Last-Modified: Sat, 25 May 2002 20:51:33 GMTETag: "56497-51-3ceff955"Accept-Ranges: bytesContent-Length: 81Keep-Alive: timeout=15, max=100Connection: Keep-AliveContent-Type: text/html

<HTML><BODY><H1>Internet Lab</H1>Click <a href="http://www.tcpip-lab.net/index.html">here</a> for the Internet Lab webpage.</BODY></HTML>

• How does the HTTP request get from Argon to Neon ?

Page 36: CcompSci356 Computer Network Architecture Lecture 25 ...

From HTTP to TCP

• To send request, HTTP client program establishes an TCP connection to the HTTP server Neon.• The HTTP server at Neon has a TCP server

running

HTTP client

TCP client

Argon

HTTP server

TCP server

Neon

HTTP request / HTTP response

TCP connection

Page 37: CcompSci356 Computer Network Architecture Lecture 25 ...

Resolving hostnames and port numbers

• Since TCP does not work with hostnames and also would not know how to find the HTTP server program at Neon, two things must happen:

1. The name �neon.tcpip-lab.edu� must be translated into a 32-bit IP address.

2. The HTTP server at Neon must be identified by a 16-bit port number.

Page 38: CcompSci356 Computer Network Architecture Lecture 25 ...

Translating a hostname into an IP address

• The translation of the hostname neon.tcpip-lab.edu into an IP address is done via a database lookup

– gethostbyname(host)• The distributed database used is called the Domain Name

System (DNS)• All machines on the Internet have an IP address:

argon.tcpip-lab.edu 128.143.137.144neon.tcpip-lab.edu 128.143.71.21

HTTP client DNS Server

argon.tcpip-lab.edu 128.143.136.15

neon.tcpip-lab.edu

128.143.71.21

Page 39: CcompSci356 Computer Network Architecture Lecture 25 ...

Finding the port number

• Note: Most services on the Internet are reachable via well-known ports. E.g. All HTTP servers on the Internet can be reached at port number �80�.

• So: Argon simply knows the port number of the HTTP server at a remote machine.

• On most Unix systems, the well-known ports are listed in a file with name /etc/services. The well-known port numbers of some of the most popular services are:

ftp 21 finger 79telnet 23 http 80smtp 25 nntp 119

Page 40: CcompSci356 Computer Network Architecture Lecture 25 ...

Requesting a TCP Connection

• The HTTP client at argon.tcpip-lab.edu requests the TCP client to establish a connection to port 80 of the machine with address 128.141.71.21

HTTP client

TCP client

argon.tcpip-lab.edu

Establish a TCP connectionto port 80 of 128.143.71.21

connect(s, (struct sockaddr*)&sin, sizeof(sin))

Page 41: CcompSci356 Computer Network Architecture Lecture 25 ...

Invoking the IP Protocol

• The TCP client at Argon sends a request to establish a connection to port 80 at Neon

• This is done by asking its local IP module to send an IP datagram to 128.143.71.21

• (The data portion of the IP datagram contains the request to open a connection)

TCP client

argon.tcpip-lab.edu

IP

Send an IP datagram to128.143.71.21

Page 42: CcompSci356 Computer Network Architecture Lecture 25 ...

Sending the IP datagram to the default router

• Argon sends the IP datagram to its default router• The default gateway is an IP router• The default gateway for Argon is

Router137.tcpip-lab.edu (128.143.137.1).

Page 43: CcompSci356 Computer Network Architecture Lecture 25 ...

Invoking the device driver

• The IP module at Argon, tells its Ethernet device driver to send an Ethernet frame to address 00:e0:f9:23:a8:20

• Ethernet address of the default router is found out via ARP

argon.tcpip-lab.edu

IP module

Ethernet

Send an Ethernet frameto 00:e0:f9:23:a8:20

Page 44: CcompSci356 Computer Network Architecture Lecture 25 ...

The route from Argon to Neon

• Note that the router has a different name for each of its interfaces.

Page 45: CcompSci356 Computer Network Architecture Lecture 25 ...

Sending an Ethernet frame

• The Ethernet device driver of Argon sends the Ethernet frame to the Ethernet network interface card (NIC)

• The NIC sends the frame onto the wire

Page 46: CcompSci356 Computer Network Architecture Lecture 25 ...

Forwarding the IP datagram

• The IP router receives the Ethernet frame at interface 128.143.137.11. recovers the IP datagram2. determines that the IP datagram should be forwarded to the interface

with name 128.143.71.1• The IP router determines that it can deliver the IP datagram directly

Page 47: CcompSci356 Computer Network Architecture Lecture 25 ...

• The IP protocol at Router71, tells its Ethernet device driver to send an Ethernet frame to address 00:20:af:03:98:28

router71.tcpip-lab.edu

IP module

Ethernet

Send a frame to00:20:af:03:98:28

Invoking the Device Driver at the Router

Page 48: CcompSci356 Computer Network Architecture Lecture 25 ...

Sending another Ethernet frame

• The Ethernet device driver of Router71 sends the Ethernet frame to the Ethernet NIC, which transmits the frame onto the wire.

Page 49: CcompSci356 Computer Network Architecture Lecture 25 ...

Data has arrived at Neon

• Neon receives the Ethernet frame • The payload of the Ethernet frame is an

IP datagram which is passed to the IP protocol.

• The payload of the IP datagram is a TCP segment, which is passed to the TCP server

HTTP server

neon.tcpip-lab.edu

TCP server

IP module

Ethernet