Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

28
Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak

Transcript of Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Page 1: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Zion

Pranjal JoshiPayal Shah

Vandana GoyalPriyank Gandhi

Sahil ChokshiParthiv Nayak

Page 2: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Outline

Supported Features Project Approach TCP Client-Server Architecture Testing

Page 3: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Supported Features

Iterative Server Separate server Log for each Client Separate TCB for each client Flow Control Retransmission Error Control Handling State Machine

Page 4: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Approach

Implementation of Zion APIs Benefits of using ZION API Platform: UNIX Language: C

Page 5: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Client-Server Architecture

Assigns new entry in TCB buffer & Server goes to

established state

Server will check its state for existing

client and will go to its current state

listen()

CLIENT

CLIENT

New Client (Received SYN Bit)

Existing ClientTCB Buffer

Server

Page 6: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Server Implementation zserver.c

Main() Zsocketserver Zbind Zlisten zProcessPacket

ztcp.c ZION APIs are implemented in this file.

parser.c TCP Parser

zanalyzer.c SetFlag mapFlagToEvent mapActionToFlag getTCB InitializeStateMachine ValidateState clientTCBcreate

packgen.c

Page 7: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Server Architecture

Create Socket

Listen

Decide next state and action

Process PacketCreate new TCB

Lower case/Upper case Function

Create packet

Incoming Packet

TCB lookup If foundNo

YesManage State Machine

If Ack received, stop retransmission timer.

Send to ClientSet Flags

CLIENT

Start retransmissiontimer

Log the packet

Page 8: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Implementation of TCB

Following fields are saved in the TCB IP Address Port No # TCP State Seq no # Ack no # Segment Length Window

IP address

Port no

State

Seq No

Ack No

Segment Length

Segment Window

IP address

Port no

State

Seq No

Ack No

Segment Length

Segment Window

TCP Buffer

Page 9: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Handling Multiple client communication

SERVER

CLIENT

CLIENT

CLIENT

TCB 1

TCB 2

TCB 3

Local Address, Port

Remote Address, Port

SND_UNA, SEG_SEQ etc.

Send Buffer, Receive Buffer

Log File

Page 10: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Client Architecture

Analyze receivingPacket

Client Packet Generator Connect

Parser

Server

Page 11: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Client Implementation zclient.c

Main zsendData Zclientclose Zconnect isDataAvailable

ztcp.c ZION APIs for zsocket, zbind, zlisten, zprocesspacket

parser.c TCP Parser

zclientanalyzer.c Single TCB

packgen.c

Page 12: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Test Client

Page 13: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Testing results

Testing with one client Testing with one client (multiclient environment)

Testing with multiple clients Testing with two clients Testing with more than two clients

Page 14: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Test Cases

Total no of implemented test cases 13

SYN-SYNACK-SYN  After data transfer, send RST SYN-SYN ACK-RST Listen Mode Retransmission of Data when ACK is not received Half Open Connection After server crash RANDOM Attack by Malicious Client (DoS)

Page 15: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Test Case 1: Sending 2 SYN in Connection Establishment

Client Sever

SYN=1 SEQ= 20000

SYN=1 ACK=1 SEQ= 6000 ACK= 20001

SYN= 1 SEQ=20001 ACK= 60001

RST=1 SEQ=1 ACK= 20001

Page 16: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Received SYN

Sending RST

Test Case 1: Sending 2 SYN during connection establishment

Page 17: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Test case 2: Sending RST after connection establishment

SYN=1 SEQ= 20000

SYN=1 ACK=1 SEQ= 6000 ACK= 20001

ACK=1

RST=1 SEQ=1

CLIENT

SERVER

Received RST after connection establishment

Page 18: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Test Case 3: Send RST after data transfer

Sever

SYN=1 SEQ= 20000

SYN=1 ACK=1 SEQ=6000 ACK=20001

ACK=1 SEQ=20001 ACK= 6001

RST=1

Client

Data 1

ACK=1 for Data 1

Data 2

ACK=1 for Data 2

Page 19: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Sending RST

Test Case 3: Sending 2 SYN during connection establishment

Page 20: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Test Case 4: Retransmission of Data when ACK is not received

CLIENT

SERVER

Normal transfer RetransmissionSYN

SYN- ACK

ACK

DATA

ACK

CLIENT

SERVER

SYN

SYN- ACK

ACK

DATA

ACK LOST

Retransmit DATA

ACK

Page 21: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Retransmitted packet

ACK of Retransmitted

packet

Page 22: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Half Open Connection After server crash

CLIENT

CLIENT

SERVER

SYN

SYN- ACK

ACK

DATA

NO ACK

Retransmit DATA

RST

Server Crash

Server Restart

Server has no knowledge of connection

Page 23: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Received RST from server

Connection ESTABLISHED,

sending data

Client Side Screenshot

Page 24: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

SERVER side screen shot

Killed the server [^C] and Restarted

Received Packet from CLIENT NO Connection, so

send RST

Page 25: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

RANDOM Attack by Malicious Client

CLIENT

CLIENT

SERVER

RST

RST

SYN+FIN

DATA

RST

SYN+FIN+PSH

SYN+ACK

RST

SYN+ACK+FIN+URG

Drop Packet

Drop Packet

RST

Page 26: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Testing with other groups

Team Name Status

Lassen Passed

Crater Lake Passed

Acadia Passed

Passed

Page 27: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Future development

TCP options Checksum

Page 28: Zion Pranjal Joshi Payal Shah Vandana Goyal Priyank Gandhi Sahil Chokshi Parthiv Nayak.

Thank You

Q & A