240 likes | 407 Views
Implementation of TCP over UDP. Team : Fortworth Piyush Patel Hiren Bhorania Dhiwakar Mani Ketan Nawal. Agenda. Introduction Server design Concurrency Flow Reliability Test cases. Goal. Provide a TCP like 207 layer over the UDP protocol
E N D
Implementation of TCP over UDP Team : Fortworth Piyush Patel Hiren Bhorania Dhiwakar Mani Ketan Nawal
Agenda • Introduction • Server design • Concurrency • Flow • Reliability • Test cases
Goal • Provide a TCP like 207 layer over the UDP protocol • Implement TCP like 207 protocol to develop 207 Server which provides TCP like functionalities • Provide application on top of 207 layer
Features • Packet Generator • Packet Parser • Connection Management • Data transfer • Reliability • Flow control • Error control • Concurrency • Application
Server Design • Multi threaded Server • Descriptor table • Master handles incoming packets • Message queues for each child thread • Packets get buffered in child’s queue • Child thread waits for packet in its queue
Q Q Q 207 Server Descriptor table Master Slave 1 Slave 1 Slave 1 Concurrency (Cont…)
Data transfer and connection termination • Master thread handles and check initial packet • Slave thread completes handshaking and handles data transfer and connection termination • Master remove the thread after completion and free the resources • Four way teardown
Packet Generator • Single function to prepare outgoing data • Set the flags of the header • Append data to it, if any • Append pseudo header to it • Calculate checksum • Remove pseudo header • Print the segment
Packet Parser • Single function to check on incoming data • Check on the flags of the header • Calculate checksum • Compare checksum • Print the segment • Separate data from header
Error Control • Checksum • Scenario
Error control (Cont…) • Psuedo header format • typedef struct { uint32_t src_adr; uint32_t dst_adr; uint16_t offset : 8, protocol : 8; uint16_t hlen; }PSEUDO207;
Flow Control • Basic windowing • Check incoming window size • Set proper outgoing window size • Server advertise the window size first • Server set outgoing buffer according to client’s window • Same procedure is followed at client side • Sequencing • Check sequence number and update entries in TCB • If out of sequence packet arrives in data transfer then send the ACK again
Logging • Log file for each session • Logging capability for each incoming and outgoing packet • Logging in a text file • Log error messages and connection state
Test Case - 1 SERVER CLIENT SYN SYN-ACK SYN RST
Test Case - 2 CLIENT SERVER Data Transfer SYN RST
Test Case - 3 SERVER CLIENT All Flags ON RST
Test Case - 4 SERVER CLIENT Not SYN packet RST
Test Case - 5 CLIENT SERVER SYN 1 SYN 2 SYN 3 SYN 4 SYN 10 SYN 11 Drop
Reference • RFC 793 • http://www.unpbook.com/unpv13e.tar.gz • https://computing.llnl.gov/tutorials/pthreads/