CS 395-0, Section 22 Project Part B Dinda, Fall TCP for Minet. Project Part B

Similar documents
TCP for Minet. Project 2. Building Minet For this project you will use the same build process as you used in project 1.

TCP for Minet. Project 2

Web Client And Server

Project 1: Web Client and Server

The Minet TCP/IP Stack

Project 1: Web Client and Server

Web Client And Server

TCP : Fundamentals of Computer Networks Bill Nace

TSIN02 - Internetworking

05 Transmission Control Protocol (TCP)

TSIN02 - Internetworking

QUIZ: Longest Matching Prefix

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

User Datagram Protocol

ECE 650 Systems Programming & Engineering. Spring 2018

Flowreplay Design Notes

TSIN02 - Internetworking

TSIN02 - Internetworking

Kent State University

Introduction to Computer Systems

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

TCP TCP/IP: TCP. TCP segment. TCP segment. TCP encapsulation. TCP encapsulation 1/25/2012. Network Security Lecture 6

Congestion Control. Daniel Zappala. CS 460 Computer Networking Brigham Young University

Question Score 1 / 19 2 / 19 3 / 16 4 / 29 5 / 17 Total / 100

Basic Reliable Transport Protocols

CSCD 330 Network Programming Spring Lecture 1 - Course Details

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING

EEC-682/782 Computer Networks I

RSC Part III: Transport Layer 3. TCP

Computer Communication Networks Midterm Review

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

Homework 1 CS 642: Information Security

Internetworking With TCP/IP

Transport Protocols. Raj Jain. Washington University in St. Louis

Transport Layer (TCP/UDP)

6. The Transport Layer and protocols

Introduction to TCP/IP networking

Reliable File Transfer

CSCI-GA Operating Systems. Networking. Hubertus Franke

CS 43: Computer Networks. 19: TCP Flow and Congestion Control October 31, Nov 2, 2018

Spring 2006: Project # 3 Reliable Sliding-Window Transport

Introduction to Networks and the Internet

CS155: Computer Security Spring Project #1. Due: Part 1: Thursday, April pm, Part 2: Monday, April pm.

Introduction to Computer Systems

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided.

UNIT V. Computer Networks [10MCA32] 1

Stateless Firewall Implementation

CS 385 Operating Systems Fall 2011 Homework Assignment 5 Process Synchronization and Communications

CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

Internetworking With TCP/IP

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

I TCP 1/2. Internet TA: Connection-oriented (virtual circuit) Connectionless (datagram) (flow control) (congestion control) TCP Connection-oriented

Department of Electrical and Information Technology ETSF10 Internet Protocols Home Laboratory Project II

University of Toronto Faculty of Applied Science and Engineering. Final Exam, December ECE 461: Internetworking Examiner: J.

User Datagram Protocol (UDP):

CS155: Computer Security Spring Project #1

4.0.1 CHAPTER INTRODUCTION

Transport Layer Marcos Vieira

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput

Networking Technologies and Applications

CNT 6885 Network Review on Transport Layer

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

CS 457 Networking and the Internet. Network Overview (cont d) 8/29/16. Circuit Switching (e.g., Phone Network) Fall 2016 Indrajit Ray

Internetworking Models The OSI Reference Model

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

Lenuta Alboaie Computer Networks

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

CS457 Transport Protocols. CS 457 Fall 2014

Lecture 2. Outline. Layering and Protocols. Network Architecture. Layering and Protocols. Layering and Protocols. Chapter 1 - Foundation

Chapter 3- parte B outline

ch02 True/False Indicate whether the statement is true or false.

Routing Lab. Project 3

TPF 4.1 Communications - TCP/IP Enhancements

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

The aim of this unit is to review the main concepts related to TCP and UDP transport protocols, as well as application protocols. These concepts are

Chapter 3 Transport Layer

Announcements. More Announcements. Brief History of Networking. How does a computer send messages over the Internet? 12/7/11

COSC 6377 Mid-Term #2 Fall 2000

TCP/IP. Chapter 5: Transport Layer TCP/IP Protocols

(Refer Slide Time: 1:09)

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action

Lecture 3: The Transport Layer: UDP and TCP

EE 122: Transport Protocols. Kevin Lai October 16, 2002

Application Service Models

Sirindhorn International Institute of Technology Thammasat University

Once all of the features of Intel Active Management Technology (Intel

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

CIT 480: Securing Computer Systems

Chapter III: Transport Layer

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers.

ENCE 3241 Data Lab. 60 points Due February 19, 2010, by 11:59 PM

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003.

Lecture 11: Transport Layer Reliable Data Transfer and TCP

Outline : Computer Networking. Objectives. Who s Who? Administrivia. Layering. L-1 Intro to Computer Networks

CS Programming Languages Fall Homework #2

Transcription:

TCP for Minet Project Part B Overview In this part of the project, you and your partner will build an implementation of TCP for the Minet TCP/IP stack. You will be provided with all parts of the stack except for the TCP module. You may implement the module in any way that you wish so long as it conforms to its interfaces to other Minet components, and to the reduced TCP standard described here. However, Minet provides a considerable amount of code, in the form of C++ classes, that you may use in your implementation. Furthermore, we recommend that you implement your module as a select-based server, similar in spirit to the third part of your previous project. You may also earn extra credit by implementing additional parts of the TCP standard. The Minet TCP/IP Stack The Minet TCP/IP Stack is documented in a separate, eponymous handout. The lowlevel details of how Minet works, including the classes it makes available to you, the modules out of which the stack is constructed, and how the modules interface with each other is documented in that handout. Of course, it also doesn t hurt to look at the code. You will be given the source code to all of the Minet modules except for tcp_module and ip_module. You will also receive binaries for ip_module, reader, and writer. It is vital that you use the reader and writer binaries that we give you. These programs must be run as root or else they will not work. Because we don t want to give you root access, we are giving you binaries that are setuid to root. This means that these programs (and only these programs) run as root. If you would like to use reader and writer on a machine outside the TLAB, you will need root privileges on that machine. Your IP Addresses Each of you will be assigned 255 IP addresses to use for the rest of the quarter. These address are of the form 10.10.x.y, where x will depend on your login id and y will range from 1 to 255. These addresses are special in that packets sent to them will not be forwarded beyond the local network. In fact, if you are using machines other than the TLAB machines, you will need to add a route so that they actually make it to the local network. Dedicated TLAB Machines You may use any of the TLAB machines, either from the console or remotely via ssh. In fact, you ll usually want to use two of them simultaneously. We have dedicated TLAB- 11 through TLAB-15 to running Linux for the duration of the quarter. These machines should always be available for remote or console login. If they are not, send mail to request@cs.cmu.edu. Skysaw will also continue to be available, but you will find it easier to work on this project on the TLAB machines. Note that Skysaw is not on the Page 1 of 5

same network as the TLAB machines, so you will not be able to communicate with them using your 10.10.x.y addresses. TCP Specification The core specification for TCP is RFC 793, which you can and should fetch from www.ietf.org. In general, you will implement TCP as defined in that document, except for the parts listed below. You do not have to support outstanding connections (i.e., an incoming connection queue to support the listen backlog) in a passive open. You do not have to implement congestion control. You do not have to implement support for the URG and PSH flags, the urgent pointer, or urgent (out-of-band) data. You do not have to support TCP options. You do not have to implement a keep-alive timer You do not have to implement the Nagle algorithm. You do not have to implement delayed acknowledgements. You do not have to generate or handle ICMP errors. You may assume that simultaneous opens and closes do not occur You may assume that sock_module only makes valid requests (that is, you do not have to worry about application errors) You may assume that exceptional conditions such as aborts do not occur. You should generate IP packets no larger than 576 bytes, and you should set your MSS (maximum [TCP] segment size) accordingly, to 536 bytes. Notice that this is the default MSS that TCP uses if there is no MSS option when a connection is negotiated. Chapter 3 of your textbook also serves as an excellent introduction to TCP concepts and should be read before the RFC. In addition, we will be handing out other information as the quarter progresses. Rick Steven s book, TCP/IP Illustrated, Volume1: The Protocols is also very useful, as is Doug Comer s Internetworking With TCP/IP Volume I: Principles, Protocols, and Architecture. Both of these books are available from Peter. Recommended Approach There are many ways you can approach this project. The only requirements are that you meet the TCP specification detailed above, that your TCP module interfaces correctly to the rest of the Minet stack, and that your code builds and works on the TLAB machines. We recommend, however, that you use C++ and exploit the various classes and source code available in the Minet TCP/IP stack. Furthermore, we recommend you take the roughly the following approach. 1. Read Chapter three of your textbook 2. Read RFC 793. 3. Read the Minet TCP/IP Stack handout. Page 2 of 5

4. Fetch, configure, and build Minet. 5. Examine the code in udp_module.cc. The UDP module has almost exactly the same interface to the IP multiplexor and to the Sock module as your TCP module will have. Feel free to steal this code to act as the framework for your TCP module. 6. Write a TCP module that does nothing but connect to its fifos and then repeatedly runs select, unserializes arriving packets, and prints them. You should be able to run the stack with this basic module, send traffic to it from another machine using netcat (nc), and see it arrive at your TCP module. You may find the classes in packet.h and ip.h to be useful. Now is a good time to familiarize yourself with Minet s various environment variables. You should check out what the various MINET_DISPLAY options do. 7. Learn how to use select s timeout feature. You will be using this to implement TCP s timers. 8. Write a class that represents the state of a connection. Think carefully about what this should contain. Think of a connection as being a finite state machine and consider using the states described in RFC 793. You may find the various classes in constate.h to be helpful here. In particular, your connection should have various timers associated with it. Your connection will also probably have input and output buffers associated with it. 9. Write a class that maps connection addresses (the Connection class) to connection state. Again, you may find constate.h to be helpful. 10. Add code to your TCP module to handle incoming IP packets. Begin by adding code to handle passive opens. Even without the Sock module, you can test this code by using a hard-coded connection representing a passive open. Note that the element of time enters in here. You will need to use one of your timers to deal with lost packets. You may find the classes in tcp.h and ip.h to be useful. 11. Add code to your TCP module to handle active opens. Again, you do not need to use the Sock module here. You can hard code the active open for now. 12. Add code to your TCP module to handle data transfer. Again, note the element of time and think of how to implement your timers using select. Remember that you do not have to implement congestion control, only flow control. 13. Add code to your TCP module to handle closes. 14. At this point, your TCP module should be able to carry on conversation with a hard-coded partner. Congratulations! You are finished with the most difficult part! 15. Re-read the discussion of the interface between the Sock module and the TCP module in the Minet TCP/IP Stack handout. 16. Make sure you understand the SockRequestResponse class. SockRequestResponses will advance your connections state machines just like IP packets do. They will also affect the set of outstanding connections (item 9). 17. Add code that keeps track of outstanding requests that your TCP module has passed up to the Sock module. Recall that the interface is asynchronous. When you send a request to Sock module, the response may arrive at any time later. The only guarantee is that responses will arrive in the same order that requests were sent. Page 3 of 5

18. Add code to support the CONNECT request. This should simply create a connection address to state mapping and initiate an active open. 19. Add code to support the ACCEPT request. This should simply create a connection address (with an unbound remote side) to state mapping and initiate a passive open. 20. Add code to pass incoming connections on a passively open connection address (one for which you have received an ACCEPT) up to the Sock module as zero byte WRITE requests. 21. Add code to support the CLOSE request. This should shut down the connection gracefully, and then remove the connection 22. Add code to support the WRITE request. This should push data into the connection s output queue. 23. Add code to send new data up to the Sock module as WRITE requests. Note that the Sock module may refuse such a WRITE. In such cases, the TCP module should wait and try to resend the data later. We are currently working on a better flow control protocol between the Sock module and the TCP module. 24. Verify that you are generating and handling STATUS requests correctly. 25. Change your HTTP client from the last project to use Minet (minet_init(user)). Run it as the app and verify that it works and can communicate with an HTTP server on the local network. 26. Do the same thing with your HTTP server. Note that while a Minet stack currently supports only a single application, you can run multiple Minet stacks on the same machine or on different TLAB machines to test your code. Extra Credit: Congestion control For extra credit, you may implement the congestion control parts of TCP as they are described in your textbook and in the other sources. Please note that while this is not much code, it does take considerable effort to get right. Caveat Emptor The Minet TCP/IP Stack is a work in progress. You are the first class to use it. You can and will find bugs in it. We will do our best to make your experience as pleasant and fair as possible. If you try hard, you will do well. If some part of Minet turns out to be an unexpected impediment, this will not be reflected in your grade. We also appreciate constructive feedback and suggestions. We plan to use Minet extensively for teaching in the future. Your ideas, which we will credit accordingly, can therefore have a lot of impact. Mechanics Your code must function as a tcp_module within the Minet TCP/IP Stack, as described in a separate, eponymous handout. Your code should be written in C or C++ and must compile and run under Red Hat Linux 6.2 on the machines in the TLAB. In particular, we will compile your code using GCC 2.95.2 and GNU Make 3.78.1, which are installed on the lab machines. You must provide a Makefile. We will expect that running make will generate the Page 4 of 5

executable tcp_module and that this module will meet the specification described in this document and in the Minet TCP/IP Stack handout. Things That May Help You RFC 793 is essential. Chapter 3 of your book. Section 3.5 is a good introduction to TCP. Sections 3.6 and 3.7 are about congestion control. You should read them, but you do not have to implement congestion control. Rick Stevens, TCP/IP Illustrated, Volume1: The Protocols Doug Comer, Internetworking With TCP/IP Volume I: Principles, Protocols, and Architecture Rick Steven, Advanced Programming in the Unix Environment especially handy if you are having issues with fifos. The handout Unix Systems Programming in a Nutshell The handout Make in a Nutshell The handout The TLAB Cluster The C++ Standard Template Library. Herb Schildt s STL Programming From the Ground Up appears to be a good introduction GDB, Xemacs, etc. The Introduction to the Unix Development Environment seminar that will be held on Thursday, October 12 at 6:30pm in the CS classroom. CVS (http://www.loria.fr/~molli/cvs-index.html) is a powerful tool for managing versions of your code and helping you and your partner avoid stepping on each other s toes. Page 5 of 5