SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
Applications and Reliable Transport Basics
Overview 
 Lookup and shutdown 
 Applications: power of reliable sockets 
- Telnet 
- Web/HTTP 
- BitTorrent 
- Skype 
 Challenges of reliable transport 
 Next lecture: Reliable transport details
Address lookup details 
 getaddrinfo notes: 
- Can specify port as service name or number (e.g., 80 or 
http, allows possibility of dynamically looking up port) 
- May return multiple addresses (chained with ai next field) 
- You must free structure with freeaddrinfo 
 Other useful functions to know about 
- getnameinfo – Lookup hostname based on address 
- inet ntop – convert IPv4 or 6 address to printable form 
- inet pton – convert string to IPv4 or 6 address
EOF in more detail 
 Simple client-server application 
- Client sends request 
- Server reads request, sends response 
- Client reads response 
 What happens when you’re done? 
- Client wants server to read EOF to say request is done 
- But still needs to be able to read server reply – fd is not 
closed!
shutdown system call 
 int shutdown (int fd, int how); 
- Shuts down a socket w/o closing file descriptor 
- how: 0 = reading, 1 = writing, 2 = both 
- Note: Applies to socket, not descriptor—so copies of 
descriptor (through dup or fork) affected 
- Note 2: With TCP, can’t detect if other side shuts for 
reading, so in practice 1 is only useful how argument 
 Play with uc from Lab 1 to see this 
- Pressing Ctrl-D at beginning of line sends EOF 
- uc reads EOF from standard input, uses shutdown to write 
EOF to TCP socket
Review 
 The Internet is a network of networks 
 Hourglass/narrow waist: 
host-host delivery 
- IP protocol to deliver packets to 
hosts 
- Transport above for service/ 
process demultiplexing 
- Link layer below for a single hop 
HTTP NV TFTP 
TCP UDP 
… 
FTP 
IP 
NET1 NET2 NET 
 Sockets are system call interface for communication 
n
Applications 
 Simple socket abstraction is very powerful 
- Applications can use them in many ways 
- We’ll go through four examples 
 “the intelligence is end to end rather than hidden 
in the network.” 
– [RFC 1958] (architectural principles doc) 
 Two basic questions for an application 
- What do you send? 
- Whom do you send it to?
An Reliable Socket View of theWorld 
Internet 
client server 
 Telnet: simple text stream 
 HTTP: downloading documents 
 BitTorrent: swarming large documents 
 Skype: IP telephony/lookup
Telnet 
 Server listens on port 23 
 On connection, provides a login prompt 
 Allows insecure remote logins 
 Telnet client is a text interface 
- Allows session management 
- Handles terminal control signals, etc. 
 What matters most for performance? 
Internet 
client server
Web/HTTP 
 Server listens on port 80 
 On connection, waits for a request 
 Protocol (but not data) is in ASCII 
 Sends response, maybe closes connection (client 
can ask it to stay open)
Parsing a URL 
http://cs144.scs.stanford.edu/labs/sc.html 
File 
Host 
Protocol
HTTP Request Format 
method URL version ←↓ 
header field name value ←↓ 
header field name value ←↓ 
←↓ 
request 
headers 
blank line 
body 
 Request types: GET, POST, HEAD, PUT, DELETE 
 A URL given to browser: http://localhost:8000/ 
 Resulting request: GET / HTTP/1.1 
- Someday, requests will contain the full URL not just path
A Browser Request 
GET / HTTP/1.1 
Host: localhost:8000 
User-Agent: Mozilla/5.0 (Macinto ... 
Accept: text/xml,application/xm ... 
Accept-Language: en-us,en;q=0.5 
Accept-Encoding: gzip,deflate 
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 
Keep-Alive: 300 
Connection: keep-alive 
[LiveHTTPHeaders for Firefox is good way to see this]
HTTP Response Format 
version status code phrase ←↓ 
header field name value ←↓ 
header field name value ←↓ 
←↓ 
status 
headers 
blank line 
body 
 1xx codes: Informational 
 2xx codes: Successes 
 3xx codes: Redirection 
 4xx codes: Client Error 
 5xx codes: Server Error
www.scs.stanford.edu Response 
HTTP/1.1 200 OK 
Date: Thu, 03 Apr 2008 21:09:57 GMT 
Server: Apache 
Last-Modified: Thu, 03 Jan 2008 01:05:54 GMT 
ETag: a577678157a762e3d46afd4038d9a35bf2ae9386 
Accept-Ranges: bytes 
Content-Length: 3586 
Connection: close 
Content-Type: text/html 
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN 
http://www.w3.org/TR/html4/strict.dtd 
...
HTTP Performance 
 What matters most for performance? 
 Depends on types of requests 
- Lots of small requests (loading a page) 
- Big request (fetching a download) 
 Require different solutions
Small Requests 
 Latency matters 
 Governed by round-trip-time (RTT) between hosts 
 Two major causes: 
- Opening a TCP connection 
(TCP requires 7 messages even with no data, including one 
round-trip even before you can send request) 
- Actually sending request and receiving response 
 Mitigate first cost with persistent connections
Browser Request, Revisited 
GET / HTTP/1.1 
Host: localhost:8000 
User-Agent: Mozilla/5.0 (Macinto ... 
Accept: text/xml,application/xm ... 
Accept-Language: en-us,en;q=0.5 
Accept-Encoding: gzip,deflate 
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 
Keep-Alive: 300 
Connection: keep-alive
Big Requests 
 Problem is throughput on edge link 
 Use an HTTP proxy cache (or cache locally) 
- Can also improve latency! 
clients 
server 
Internet 
proxy 
cache
Stale Caches 
 Items in the cache can go stale (you don’t want to 
read yesterday’s paper) 
 Cache needs a way to conditionally ask for a 
document 
 Issue a conditional GET (If-modified-since 
header) 
- Server can reply with a 304 Not Modified 
GET / HTTP/1.1 
Host: cs144.scs.stanford.edu 
If-modified-since: Wed, 02 Apr 2008 08:00:00 GMT
Client-Server vs. Peer-to-Peer 
 Server can be a bottleneck 
- Download time can scale O(n) with n clients 
- Scaling up server bandwidth can be expensive (CDNs, 
lecture 12) 
- Slashdotting/flash crowds 
 Peer-to-peer: get a bunch of end-hosts to distribute 
content collaboratively 
 A common peer-to-peer challenge is finding whom 
to collaborate with
BitTorrent 
 Torrent file (.torrent) describes file to download 
- Names tracker, server tracking who is participating 
- File length, piece length, SHA1 hashes of pieces 
- Additional metadata (who created torrent, etc.) 
- Also specifies tracker 
 Client contacts tracker, starts communicating with 
peers 
d8:announce47:http://vip.tracker.thepiratebay.org:80/announce7:comment20: 
THANKS FOR SEEDING!10:created by13:uTorrent/177013:creation 
datei1207365453e8:encoding5:UTF-84:infod6:lengthi839833600e4: 
name18:XXX XXXXXXXXX.avi12:piece lengthi1048576e6:pieces16020:U ....
Pieces and Sub-pieces 
 BitTorrent breaks up a file into N pieces 
- For throughput, pieces are large: 256KB–1MB 
- For latency, broken into subpieces 
 Hashes of pieces in torrent provide end-to-end 
integrity 
- Hash computes a short summary of a piece of data 
- Cryptographically strong hashes: hard to find collisions or 
data that produces a hash (more in Security lectures)
Whom To Talk To? 
 Uses a Tit-for-Tat (TFT) policy: upload only to 
those who give you data 
 Most peers are “choked” and get no data 
 Order unchoked peers by download rate, choke all 
p 
but P best (e.g., 4, 
C) 
 Occasionally unchoke a random peer (might find 
its way into P best)
What to Say? 
 Peers exchange metadata on what pieces they have 
 Download rarest pieces 
 When down to the last few pieces, ask for them 
from multiple peers
BitTorrent Communication
BitTyrant [Piatek] 
 Optional reading: 2007 research paper 
 Take advantage of altriusm 
- Many peers give more than they take 
- Rate-limit yourself just enough to be unchoked 
- Connect to more peers instead of giving each peer more 
 Leads to a median 70% performance gain!
BitTorrent Today: Engineering (IETF) 
 Locality can improve performance (lower RTT) 
 Hard for clients to know who might be local 
 Can ISPs collaborate to reduce transit costs and 
improve performance? 
 Issues of contributory infringement. . . 
 Application Layer Transport Optimization (alto) 
 Netflix renders some of this moot now...
2-minute stretch
Skype 
 Real-time communication (voice, IM, etc.) 
 Two major challenges 
- Finding what host a user is on 
- Being able to communicate with arbitrary hosts 
 All Skype traffic is encrypted 
- Researchers have mostly reverse-engineered the protocol 
- A few details are still unknown
Finding a User 
 Distributed index across super-peers 
- Super-peers cannot be behind a NAT 
- There are 7 bootstrap super-peers: 66.235.180.9, 
66.235.181.9, 212.72.49.143, 195.215.8.145, 
64.246.49.60, 64.246.49.61, 64.246.48.24 
 Uncertain exactly how this index is organized 
 As number of peers grows, so does number of 
super-peers maintaining the index (or Skype, itself 
can add them)
Talking to End-Hosts 
 What if neither host allows incoming connections? 
- This is a common issue with NATs 
- Skype is more fragile to this that BitTorrent, because 
BitTorrent can connect to any peer, while Skype wants to 
connect to a specific peer 
 Skype uses relays
Skype Communication Architecture 
clients 
super 
nodes 
bootstrap 
call super node 
relay
Skype Summary 
 Uses a distributed index to find end-hosts 
 Clients communicate directly, use relays when 
NATs are a problem
Reliable Transport Basics
Implementing reliability 
 Lab 1 requires implementing a reliable transport 
 Must overcome several challenges 
- Network can drop, duplicate, corrupt, and re-order packets 
 Techniques you will employ 
- Checksums expose bit errors (more in future lectures) 
- Acknowledgments, timeouts, and retransmissions correct 
for dropped packets 
- Sequence numbers reveal duplicate/re-ordered packets 
 Next: A few slides to get you started
Acknowledgements and Timeouts 
 Stop and wait approach to reliability 
- Send message, wait 
- Receive message, send ACK 
- Receive ACK, send next message 
- Don’t receive ACK, timeout and retransmit 
 Example: Voice echo protocol 
- Speakers acknowledge messages by repeating them 
 Okay if messages are never re-ordered/duplicated 
- True for voice radio, but not for Internet 
- For Internet, also need a sequence number in packets. . .
Finite State Machines 
 Represent protocols using state machines 
- Sender and receiver each have a state machine 
- Start in some initial state 
- Events cause each side to select a state transition 
 Transition specifies action taken 
- Specified as events/actions 
- E.g., software calls send/put packet on network 
- E.g., packet arrives/send acknowledgment
Stop and wait FSMs 
 Receiver FSM: 
Wait 
for 
Packets 
receive packet 
send ACK 
deliver packet 
 Sender FSM: 
software called send 
Wait 
Wait 
for 
for 
Data ACK 
timeout 
re-send packet 
send packet 
received ACK
Problems with Stop and Wait 
 Might duplicate packet. . . how? 
 Can’t keep pipe full 
Bandwidth 
Delay 
- For full utilization want # bytes in flight  bandwidthdelay 
(But don’t want to overload the network, either)
Sender Receiver 
Frame 
ACK 
Timeout 
Time 
Sender Receiver 
Frame 
ACK 
Timeout 
Frame 
ACK 
Timeout 
Sender Receiver 
Frame 
ACK 
Timeout 
Frame 
ACK 
Timeout 
Sender Receiver 
Frame 
Timeout 
Frame 
ACK 
Timeout 
(a) (c) 
(b) (d)
Duplicates 
 Solve problem with 1-bit counter 
- Place in both Frame and ACK 
- Receiver knows if duplicate of last frame 
- Sender won’t interpret duplicate old 
ACK as for new packet 
 This still requires some simplifying 
assumptions 
- Network itself might duplicates packets 
- Packet might be heavily delayed and 
reordered 
- Assume these don’t happen for now 
- But usually prefer weaker assumption: 
Maximum Segment Lifetime (MSL) 
Sender Receiver 
Frame 0 
ACK 0 
Time 
Frame 1 
ACK 1 
Frame 0 
ACK 0 
…

Weitere ähnliche Inhalte

Was ist angesagt?

Network Programming in Java
Network Programming in JavaNetwork Programming in Java
Network Programming in JavaTushar B Kute
 
(130316) #fitalk bit torrent protocol
(130316) #fitalk   bit torrent protocol(130316) #fitalk   bit torrent protocol
(130316) #fitalk bit torrent protocolINSIGHT FORENSIC
 
Apnic-Training-IPv6_workshop
Apnic-Training-IPv6_workshopApnic-Training-IPv6_workshop
Apnic-Training-IPv6_workshopNguyen Minh Thu
 
retrieving the mail
retrieving the mailretrieving the mail
retrieving the mailtumetr1
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in JavaTushar B Kute
 
Realtime applications with EmberJS and XMPP
Realtime applications with EmberJS and XMPPRealtime applications with EmberJS and XMPP
Realtime applications with EmberJS and XMPPrjvegasf
 
HyperText Transfer Protocol
HyperText Transfer ProtocolHyperText Transfer Protocol
HyperText Transfer Protocolponduse
 
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYAPYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYAMaulik Borsaniya
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptwebhostingguy
 
Whole c++ lectures ITM1 Th
Whole c++ lectures ITM1 ThWhole c++ lectures ITM1 Th
Whole c++ lectures ITM1 ThAram Mohammed
 
May proxy be_with_you
May proxy be_with_youMay proxy be_with_you
May proxy be_with_youHimani Singh
 
Optimizing LAMPhp Applications
Optimizing LAMPhp ApplicationsOptimizing LAMPhp Applications
Optimizing LAMPhp ApplicationsPiyush Goel
 
Xmpp presentation
Xmpp presentationXmpp presentation
Xmpp presentationJava Pro
 
Java networking programs - theory
Java networking programs - theoryJava networking programs - theory
Java networking programs - theoryMukesh Tekwani
 

Was ist angesagt? (20)

US07FFT-mod_ftp.ppt
US07FFT-mod_ftp.pptUS07FFT-mod_ftp.ppt
US07FFT-mod_ftp.ppt
 
P2p cdn
P2p cdnP2p cdn
P2p cdn
 
Http Protocol
Http ProtocolHttp Protocol
Http Protocol
 
Network Programming in Java
Network Programming in JavaNetwork Programming in Java
Network Programming in Java
 
(130316) #fitalk bit torrent protocol
(130316) #fitalk   bit torrent protocol(130316) #fitalk   bit torrent protocol
(130316) #fitalk bit torrent protocol
 
Apnic-Training-IPv6_workshop
Apnic-Training-IPv6_workshopApnic-Training-IPv6_workshop
Apnic-Training-IPv6_workshop
 
Web tcp ip
Web tcp ipWeb tcp ip
Web tcp ip
 
retrieving the mail
retrieving the mailretrieving the mail
retrieving the mail
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Realtime applications with EmberJS and XMPP
Realtime applications with EmberJS and XMPPRealtime applications with EmberJS and XMPP
Realtime applications with EmberJS and XMPP
 
HyperText Transfer Protocol
HyperText Transfer ProtocolHyperText Transfer Protocol
HyperText Transfer Protocol
 
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYAPYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
Whole c++ lectures ITM1 Th
Whole c++ lectures ITM1 ThWhole c++ lectures ITM1 Th
Whole c++ lectures ITM1 Th
 
May proxy be_with_you
May proxy be_with_youMay proxy be_with_you
May proxy be_with_you
 
Optimizing LAMPhp Applications
Optimizing LAMPhp ApplicationsOptimizing LAMPhp Applications
Optimizing LAMPhp Applications
 
java networking
 java networking java networking
java networking
 
Xmpp presentation
Xmpp presentationXmpp presentation
Xmpp presentation
 
Java networking programs - theory
Java networking programs - theoryJava networking programs - theory
Java networking programs - theory
 

Ähnlich wie Computer network (10)

Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guideSrihari
 
Understanding the Web through HTTP
Understanding the Web through HTTPUnderstanding the Web through HTTP
Understanding the Web through HTTPOlivia Brundage
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser NetwrokingShuya Osaki
 
Simplified Networking and Troubleshooting for K-12 Teachers
Simplified Networking and Troubleshooting for K-12 TeachersSimplified Networking and Troubleshooting for K-12 Teachers
Simplified Networking and Troubleshooting for K-12 Teacherswebhostingguy
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebSteffen Gebert
 
Taking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketTaking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketShahriar Hyder
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1hussulinux
 
Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocolsDaniel Austin
 
Web Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The BasicsWeb Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The BasicsWebsecurify
 
HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1Daniel Austin
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 IntroductionWalter Liu
 
Socket programming with php
Socket programming with phpSocket programming with php
Socket programming with phpElizabeth Smith
 
application layer protocol for iot.pptx
application layer protocol for iot.pptxapplication layer protocol for iot.pptx
application layer protocol for iot.pptxaravind Guru
 
Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)kholis_mjd
 

Ähnlich wie Computer network (10) (20)

Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guide
 
HTTP
HTTPHTTP
HTTP
 
Understanding the Web through HTTP
Understanding the Web through HTTPUnderstanding the Web through HTTP
Understanding the Web through HTTP
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser Netwroking
 
Simplified Networking and Troubleshooting for K-12 Teachers
Simplified Networking and Troubleshooting for K-12 TeachersSimplified Networking and Troubleshooting for K-12 Teachers
Simplified Networking and Troubleshooting for K-12 Teachers
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
 
Taking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketTaking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocket
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocols
 
The HTTP and Web
The HTTP and Web The HTTP and Web
The HTTP and Web
 
Web Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The BasicsWeb Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The Basics
 
Network Testing ques
Network Testing quesNetwork Testing ques
Network Testing ques
 
Http2
Http2Http2
Http2
 
HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
 
Socket programming with php
Socket programming with phpSocket programming with php
Socket programming with php
 
Application Layer
Application Layer Application Layer
Application Layer
 
application layer protocol for iot.pptx
application layer protocol for iot.pptxapplication layer protocol for iot.pptx
application layer protocol for iot.pptx
 
Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)
 
Http
HttpHttp
Http
 

Mehr von NYversity

Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1NYversity
 
3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-distNYversity
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28NYversity
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27NYversity
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26NYversity
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25NYversity
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24NYversity
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23NYversity
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22NYversity
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20NYversity
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19NYversity
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18NYversity
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17NYversity
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16NYversity
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15NYversity
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14NYversity
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13NYversity
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12NYversity
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11NYversity
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10NYversity
 

Mehr von NYversity (20)

Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1
 
3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-dist
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10
 

Kürzlich hochgeladen

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 

Kürzlich hochgeladen (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 

Computer network (10)

  • 1. Applications and Reliable Transport Basics
  • 2. Overview Lookup and shutdown Applications: power of reliable sockets - Telnet - Web/HTTP - BitTorrent - Skype Challenges of reliable transport Next lecture: Reliable transport details
  • 3. Address lookup details getaddrinfo notes: - Can specify port as service name or number (e.g., 80 or http, allows possibility of dynamically looking up port) - May return multiple addresses (chained with ai next field) - You must free structure with freeaddrinfo Other useful functions to know about - getnameinfo – Lookup hostname based on address - inet ntop – convert IPv4 or 6 address to printable form - inet pton – convert string to IPv4 or 6 address
  • 4. EOF in more detail Simple client-server application - Client sends request - Server reads request, sends response - Client reads response What happens when you’re done? - Client wants server to read EOF to say request is done - But still needs to be able to read server reply – fd is not closed!
  • 5. shutdown system call int shutdown (int fd, int how); - Shuts down a socket w/o closing file descriptor - how: 0 = reading, 1 = writing, 2 = both - Note: Applies to socket, not descriptor—so copies of descriptor (through dup or fork) affected - Note 2: With TCP, can’t detect if other side shuts for reading, so in practice 1 is only useful how argument Play with uc from Lab 1 to see this - Pressing Ctrl-D at beginning of line sends EOF - uc reads EOF from standard input, uses shutdown to write EOF to TCP socket
  • 6. Review The Internet is a network of networks Hourglass/narrow waist: host-host delivery - IP protocol to deliver packets to hosts - Transport above for service/ process demultiplexing - Link layer below for a single hop HTTP NV TFTP TCP UDP … FTP IP NET1 NET2 NET Sockets are system call interface for communication n
  • 7. Applications Simple socket abstraction is very powerful - Applications can use them in many ways - We’ll go through four examples “the intelligence is end to end rather than hidden in the network.” – [RFC 1958] (architectural principles doc) Two basic questions for an application - What do you send? - Whom do you send it to?
  • 8. An Reliable Socket View of theWorld Internet client server Telnet: simple text stream HTTP: downloading documents BitTorrent: swarming large documents Skype: IP telephony/lookup
  • 9. Telnet Server listens on port 23 On connection, provides a login prompt Allows insecure remote logins Telnet client is a text interface - Allows session management - Handles terminal control signals, etc. What matters most for performance? Internet client server
  • 10. Web/HTTP Server listens on port 80 On connection, waits for a request Protocol (but not data) is in ASCII Sends response, maybe closes connection (client can ask it to stay open)
  • 11. Parsing a URL http://cs144.scs.stanford.edu/labs/sc.html File Host Protocol
  • 12. HTTP Request Format method URL version ←↓ header field name value ←↓ header field name value ←↓ ←↓ request headers blank line body Request types: GET, POST, HEAD, PUT, DELETE A URL given to browser: http://localhost:8000/ Resulting request: GET / HTTP/1.1 - Someday, requests will contain the full URL not just path
  • 13. A Browser Request GET / HTTP/1.1 Host: localhost:8000 User-Agent: Mozilla/5.0 (Macinto ... Accept: text/xml,application/xm ... Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive [LiveHTTPHeaders for Firefox is good way to see this]
  • 14. HTTP Response Format version status code phrase ←↓ header field name value ←↓ header field name value ←↓ ←↓ status headers blank line body 1xx codes: Informational 2xx codes: Successes 3xx codes: Redirection 4xx codes: Client Error 5xx codes: Server Error
  • 15. www.scs.stanford.edu Response HTTP/1.1 200 OK Date: Thu, 03 Apr 2008 21:09:57 GMT Server: Apache Last-Modified: Thu, 03 Jan 2008 01:05:54 GMT ETag: a577678157a762e3d46afd4038d9a35bf2ae9386 Accept-Ranges: bytes Content-Length: 3586 Connection: close Content-Type: text/html !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd ...
  • 16. HTTP Performance What matters most for performance? Depends on types of requests - Lots of small requests (loading a page) - Big request (fetching a download) Require different solutions
  • 17. Small Requests Latency matters Governed by round-trip-time (RTT) between hosts Two major causes: - Opening a TCP connection (TCP requires 7 messages even with no data, including one round-trip even before you can send request) - Actually sending request and receiving response Mitigate first cost with persistent connections
  • 18. Browser Request, Revisited GET / HTTP/1.1 Host: localhost:8000 User-Agent: Mozilla/5.0 (Macinto ... Accept: text/xml,application/xm ... Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive
  • 19. Big Requests Problem is throughput on edge link Use an HTTP proxy cache (or cache locally) - Can also improve latency! clients server Internet proxy cache
  • 20. Stale Caches Items in the cache can go stale (you don’t want to read yesterday’s paper) Cache needs a way to conditionally ask for a document Issue a conditional GET (If-modified-since header) - Server can reply with a 304 Not Modified GET / HTTP/1.1 Host: cs144.scs.stanford.edu If-modified-since: Wed, 02 Apr 2008 08:00:00 GMT
  • 21. Client-Server vs. Peer-to-Peer Server can be a bottleneck - Download time can scale O(n) with n clients - Scaling up server bandwidth can be expensive (CDNs, lecture 12) - Slashdotting/flash crowds Peer-to-peer: get a bunch of end-hosts to distribute content collaboratively A common peer-to-peer challenge is finding whom to collaborate with
  • 22. BitTorrent Torrent file (.torrent) describes file to download - Names tracker, server tracking who is participating - File length, piece length, SHA1 hashes of pieces - Additional metadata (who created torrent, etc.) - Also specifies tracker Client contacts tracker, starts communicating with peers d8:announce47:http://vip.tracker.thepiratebay.org:80/announce7:comment20: THANKS FOR SEEDING!10:created by13:uTorrent/177013:creation datei1207365453e8:encoding5:UTF-84:infod6:lengthi839833600e4: name18:XXX XXXXXXXXX.avi12:piece lengthi1048576e6:pieces16020:U ....
  • 23. Pieces and Sub-pieces BitTorrent breaks up a file into N pieces - For throughput, pieces are large: 256KB–1MB - For latency, broken into subpieces Hashes of pieces in torrent provide end-to-end integrity - Hash computes a short summary of a piece of data - Cryptographically strong hashes: hard to find collisions or data that produces a hash (more in Security lectures)
  • 24. Whom To Talk To? Uses a Tit-for-Tat (TFT) policy: upload only to those who give you data Most peers are “choked” and get no data Order unchoked peers by download rate, choke all p but P best (e.g., 4, C) Occasionally unchoke a random peer (might find its way into P best)
  • 25. What to Say? Peers exchange metadata on what pieces they have Download rarest pieces When down to the last few pieces, ask for them from multiple peers
  • 27. BitTyrant [Piatek] Optional reading: 2007 research paper Take advantage of altriusm - Many peers give more than they take - Rate-limit yourself just enough to be unchoked - Connect to more peers instead of giving each peer more Leads to a median 70% performance gain!
  • 28. BitTorrent Today: Engineering (IETF) Locality can improve performance (lower RTT) Hard for clients to know who might be local Can ISPs collaborate to reduce transit costs and improve performance? Issues of contributory infringement. . . Application Layer Transport Optimization (alto) Netflix renders some of this moot now...
  • 30. Skype Real-time communication (voice, IM, etc.) Two major challenges - Finding what host a user is on - Being able to communicate with arbitrary hosts All Skype traffic is encrypted - Researchers have mostly reverse-engineered the protocol - A few details are still unknown
  • 31. Finding a User Distributed index across super-peers - Super-peers cannot be behind a NAT - There are 7 bootstrap super-peers: 66.235.180.9, 66.235.181.9, 212.72.49.143, 195.215.8.145, 64.246.49.60, 64.246.49.61, 64.246.48.24 Uncertain exactly how this index is organized As number of peers grows, so does number of super-peers maintaining the index (or Skype, itself can add them)
  • 32. Talking to End-Hosts What if neither host allows incoming connections? - This is a common issue with NATs - Skype is more fragile to this that BitTorrent, because BitTorrent can connect to any peer, while Skype wants to connect to a specific peer Skype uses relays
  • 33. Skype Communication Architecture clients super nodes bootstrap call super node relay
  • 34. Skype Summary Uses a distributed index to find end-hosts Clients communicate directly, use relays when NATs are a problem
  • 36. Implementing reliability Lab 1 requires implementing a reliable transport Must overcome several challenges - Network can drop, duplicate, corrupt, and re-order packets Techniques you will employ - Checksums expose bit errors (more in future lectures) - Acknowledgments, timeouts, and retransmissions correct for dropped packets - Sequence numbers reveal duplicate/re-ordered packets Next: A few slides to get you started
  • 37. Acknowledgements and Timeouts Stop and wait approach to reliability - Send message, wait - Receive message, send ACK - Receive ACK, send next message - Don’t receive ACK, timeout and retransmit Example: Voice echo protocol - Speakers acknowledge messages by repeating them Okay if messages are never re-ordered/duplicated - True for voice radio, but not for Internet - For Internet, also need a sequence number in packets. . .
  • 38. Finite State Machines Represent protocols using state machines - Sender and receiver each have a state machine - Start in some initial state - Events cause each side to select a state transition Transition specifies action taken - Specified as events/actions - E.g., software calls send/put packet on network - E.g., packet arrives/send acknowledgment
  • 39. Stop and wait FSMs Receiver FSM: Wait for Packets receive packet send ACK deliver packet Sender FSM: software called send Wait Wait for for Data ACK timeout re-send packet send packet received ACK
  • 40. Problems with Stop and Wait Might duplicate packet. . . how? Can’t keep pipe full Bandwidth Delay - For full utilization want # bytes in flight bandwidthdelay (But don’t want to overload the network, either)
  • 41. Sender Receiver Frame ACK Timeout Time Sender Receiver Frame ACK Timeout Frame ACK Timeout Sender Receiver Frame ACK Timeout Frame ACK Timeout Sender Receiver Frame Timeout Frame ACK Timeout (a) (c) (b) (d)
  • 42. Duplicates Solve problem with 1-bit counter - Place in both Frame and ACK - Receiver knows if duplicate of last frame - Sender won’t interpret duplicate old ACK as for new packet This still requires some simplifying assumptions - Network itself might duplicates packets - Packet might be heavily delayed and reordered - Assume these don’t happen for now - But usually prefer weaker assumption: Maximum Segment Lifetime (MSL) Sender Receiver Frame 0 ACK 0 Time Frame 1 ACK 1 Frame 0 ACK 0 …