• Multiple packets in pipeline at same time
  • Packets may be damaged
  • Packets may arrive out of order
  • Packets may be duplicated
  • They may not arrive at all!

Summary so far: Applications send and receive data in packets over an Internet that is unreliable.

How packets find their way across the Internet?

Internet addresses

| Data | Internet “IP” Address |

All Internet packets carry a destination IP address. We usually write the IP address like this: 171.64.74.58

Routers forward packets one at a time

Routers look at IP addresses, then send packets to a router closer to the destination.

The IP address tells a router where to send the packet next. IP addresses have structure: A network in The Stanford the computer CS department University yuba.stanford.edu at Stanford University 171.64.74.58 An address managed by RIPE. An address The computer at (European Koç University www.ku.edu.tr IP Networks) 88.255.96.208

Can we see the path our packets take?

On your computer, try: “ping yuba.stanford.edu” and “traceroute yuba.stanford.edu” (Windows: “tracert yuba.stanford.edu”)

Round Trip Time (RTT) is the length time it takes for a data packet to be sent to a destination plus the time it takes for an acknowledgment of that packet to be received back at the origin.

Packets are forwarded hop-by-hop based on the final destination address.

The Internet cannot be trusted!!

  • The Internet doesn’t promise to deliver packets in order.
  • It doesn’t promise to deliver packets quickly, or on time.
  • It doesn’t even promise to deliver them at all!
  • It just makes a “best-effort” attempt.

Sending data reliably over an Internet that is unreliable.

How Network Applications Communicate

The most common method:

  • Communication is in both directions – “bidirectional”.

  • Communication is reliable

    (if there is a working path between the two computers).

It’s like an unformatted pipe:

  • You push data in at one end, and it pops out correctly at the other end.
  • The applications decide how the data is formatted inside the pipe.

Byte Stream Model

  • Setup connection
  • Stream of bytes
  • Close connection

World Wide Web (HTTP)

  • Setup connection

  • Stream of bytes

    GET/HTTP/1.1 index.html

    HTTP/1.1 200 OK <…contents of index.html…>

  • Close connection

TCP makes sure all the data is delivered

TCP’s job

Makes sure all data is delivered correctly. Delivers data to the application in the right order.

How?

  • Add sequence numbers to every packet (so the receiver can check if any are missing, and put them in right order)
  • When a packet arrives, send an acknowledgment of receipt or “ACK” back to the sender
  • If no acknowledgment is received, resend the data

Packets are “encapsulated” by different “layers” of processing

Summary

Applications send and receive data in packets over an Internet that is unreliable.

Packets are forwarded hop-by-hop using the IP destination address.

Our applications use TCP to make sure they are delivered and put back in the correct order.