cs398 Lecture Notes Spring 2000 Week 2, Thursday For today you should have read Section 1.3 and the Java Socket section of the Java Tutorial. Homework #1 is due on Tuesday. You should have read it, talked to your partner, and done the first part. Quiz today. For Tuesday, start reading Chapter 2. As always, start by taking a tour. It's 100 pages long!!! I'll give you an overview, and then your assignment for the weekend is to take a first pass through Section 2.1 through 2.5. See what looks interesting. Next week I will survey you on which topics you want to pursue in depth. Transport protocols ------------------- http is an application-level protocol that determines a coding for the message "send me the file named fred.html" maybe the message looks like GET fred.html actually, I have no idea what it looks like, but assume that's it. It is 13 bytes long. In theory, your browser could invoke the network card's device driver directly and put these bits on the wire. But: 1) when they got to the first internal node, how would it know what to do with them? 2) assuming it somehow got to the destination, how would the recipient know how to interpret it? 3) assuming the recipient somehow knew what it meant, how would it know where to send the reply? It would be infeasible for every network application to handle these problems themselves. That's why we need transport protocols. The fundamental transport protocol on the Internet is called IP (internet protocol). IP defines a global address space such that every node in the network has a unique address. When you transmit a message using IP, you attach a header to the message that is like an envelope. The header contains the destination address and the source (return) address. That handles (1) and (3). IP also defines a set of ports. A port is like a mailbox. A process can allocate a port and use it to send and receive data. Most network servers use a pre-defined, well-known port number. For example, web servers attach themselves to port 80. Web clients usually choose a port arbitrarily from the range of numbers that have not been preallocated. So the header contains: source IP address dest IP address source port # dest port # Internal nodes use the addresses to direct the packet to its destination. The destination host uses the dest port # to know which process to hand the packet to. The recipient process uses the contents of the packet to figure out what to do, and the source info to know who to reply to. TCP/IP ------ Actually, the previous example is not quite accurate, since what I called the transport protocol is really two protocols IP the transport protocol that handles host-to-host communication TCP the end-to-end protocol that delivers messages reliably and handles process-to-process commuinication The protocol stack ------------------ So the usual picture for Internet traffic is something like Application protocol Process-to-process protocol (TCP) Host-to-host protocol (IP) Network protocol (Chapter 2) Two ways to think of this stack: 1) a set of nested system calls. To send a message, the application invokes system calls like the ones in the book and the homework. These system calls are implemented by invoking procedures provided by TCP. The TCP methods are implemented by invoking procedures provided by IP. The IP methods are implemented by invoking procedures provided by the network device driver. 2) a set of nested envelopes The data from the application gets wrapped up in an envelope that identifies the sending and receiving processes (ports), the TCP header. The TCP packet gets wrapped up in an envelope that contains the destination and source machines' IP addresses, the IP header. The network level might wrap the IP packet inside another envelope containing, for example, the Ethernet address of the sender. Potential source of confusion: In the first point of view, Ethernet is encapsulated in IP, which is encapsulated in TCP, which is encapsulated the application level. In the second point of view, the actual nesting of packets within packets, it's the other way around. Chapter 2 --------- Overview: fundamental problem is getting data across a single link. 2.1 -- 2.5 talk about the general mechanisms used by network-level protocols 2.6 -- 2.8 look at network-level protocols for three link structures bus-like (Ethernet) token-ring (FDDI) wireless (no well-known names yet) 2.9 talks about the hardware-level interface (network cards and device drivers) What are the high-level concepts we want to get out of this chapter? 1) Encoding, framing, error detection/correction and reliable delivery, media access control. In each case there is a range of possible solutions. The best choice is determined by the characteristics of the network. 2) What are the characteristics of the example networks that drive their design? Did the engineers make appropriate choices? Encoding -------- Let's talk about guns. How can you send a signal with a gun? 1) x-gun salute, where x is the message. In effect, this is a unary code. 2) two, distinguishable guns? different frequencies, amplitudes? 3) synchonous codes -- sender and receiver share a clock during each clock cycle, there either is or is not a gunshot Framing ------- How do sender and receiver agree on packet boundaries? Error detection --------------- How does the network detect bit and burst errors? Reliable transmission --------------------- How does the network deal with errors when it finds them?