23
Implementation of TCP over UDP Team : Fortworth Piyush Patel Hiren Bhorania Dhiwakar Mani Ketan Nawal

Implementation of TCP over UDP

Embed Size (px)

DESCRIPTION

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 - PowerPoint PPT Presentation

Citation preview

Page 1: Implementation of TCP over UDP

Implementation of TCP over UDP

Team : FortworthPiyush PatelHiren BhoraniaDhiwakar ManiKetan Nawal

Page 2: Implementation of TCP over UDP

Agenda

• Introduction• Server design• Concurrency• Flow• Reliability• Test cases

Page 3: Implementation of TCP over UDP

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

Page 4: Implementation of TCP over UDP

Features • Packet Generator

• Packet Parser

• Connection Management

• Data transfer

• Reliability

• Flow control

• Error control

• Concurrency

• Application

Page 5: Implementation of TCP over UDP

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

Page 6: Implementation of TCP over UDP

Concurrency

Page 7: Implementation of TCP over UDP

Concurrency (Cont…)

Slave 1 Slave 1 Slave 1

Master

207 Server

Q Q Q

Descriptor table

Page 8: Implementation of TCP over UDP

Connection establishmentC reate and B ind

Listen

R eceive packet

If SYN

C reate new threadPass packet in queue

C heck client entry

N

Y

Y

C heck client entry

D iscard packet

N

N

Y N

Page 9: Implementation of TCP over UDP

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

Page 10: Implementation of TCP over UDP

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

Page 11: Implementation of TCP over UDP

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

Page 12: Implementation of TCP over UDP

Error Control

• Checksum• Scenario

Page 13: Implementation of TCP over UDP

• Psuedo header format typedef struct

{    uint32_t src_adr;    uint32_t dst_adr;        uint16_t offset : 8,               protocol : 8;        uint16_t hlen;            }PSEUDO207;

Error control (Cont…)

Page 14: Implementation of TCP over UDP

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

Page 15: Implementation of TCP over UDP

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

Page 16: Implementation of TCP over UDP

Test casesID Description

T01 Connection Establishment

T02 3-way handshake

T03 3-way handshake, Data transfer

T03 3-way handshake, Data transfer, Connection termination

T04 Conversion application test

T05 Sending Data multiple times during the established state

T06 Out of Sequence ACK received

T07 Client sending a RST

T08 Client sending an unexpected FIN

T09 Verifying concurrency in Server

T10 Multiple SYN from a client

T11 SYN during data transfer

T12 Malformed packet test

T13 All flags on packet

Page 17: Implementation of TCP over UDP

Test Case - 1

SERVERCLIENT

SYN

SYN-ACK

SYNRST

Page 18: Implementation of TCP over UDP

Test Case - 2

CLIENT SERVER

Data Transfer

SYN

RST

Page 19: Implementation of TCP over UDP

Test Case - 3

SERVERCLIENT

All Flags ON

RST

Page 20: Implementation of TCP over UDP

Test Case - 4

SERVERCLIENT

Not SYN packet

RST

Page 21: Implementation of TCP over UDP

Test Case - 5 SERVERCLIENT

SYN 2

Drop

SYN 1

SYN 4

SYN 3

SYN 10

SYN 11

Page 22: Implementation of TCP over UDP

Reference

• RFC 793 • http://www.unpbook.com/unpv13e.tar.gz• https://computing.llnl.gov/tutorials/pthreads/

Page 23: Implementation of TCP over UDP

Thank You