What to do in muxHandler()?. Get the headers  Use function MinetReceive to get the packet p.  Get the TCPHeader and IPHeader of p. You can use the function.

Slides:



Advertisements
Similar presentations
TCP/IP Christopher Zacky. lolwut Decimal Numbers.
Advertisements

Array_strcpy void array_strcpy(char dest[], char src[]) { int i = 0; while (src[i] != '\0') { dest[i] = src[i]; i++; } dest[i] = '\0'; }
COEN 252 Computer Forensics Using TCPDump / Windump for package analysis.
1 Topic 2 – Lesson 4 Packet Filtering Part I. 2 Basic Questions What is packet filtering? What is packet filtering? What elements are inside an IP header?
CISCO NETWORKING ACADEMY Chabot College ELEC Transport Layer (4)
Project 3 - TCP Original slides - Aditya Ganjam Rampaged through by – Dave Eckhardt Modified by – Vinay Chaudhary.
Introduction1-1 message segment datagram frame source application transport network link physical HtHt HnHn HlHl M HtHt HnHn M HtHt M M destination application.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
1 Reading Log Files. 2 Segment Format
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.
Instructor: Sam Nanavaty TCP/IP protocol. Instructor: Sam Nanavaty Version – Allows for the evolution of the protocol IHL (Internet header length) – Length.
Transmission Control Protocol (TCP) Basics
5/6/2015© 2010 Raymond P. Jefferis IIILect Transport Layer.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Packet Injection 101 Vivek Ramachandran. What is packet injection ? Please go through the raw socket tutorial before going further. Simply put packet.
TRANSPORT LAYER  Session multiplexing  Segmentation  Flow control (TCP)  Connection-oriented (TCP)  Reliability (TCP)
1 Transport Control Protocol. 2 Header Identifies the port number of a source application program. Used by the receiver to reply. (16-bit). Identifies.
Copyright 1999, S.D. Personick. All Rights Reserved. Telecommunications Networking II Lecture 32 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
Scanning February 23, 2010 MIS 4600 – MBA © Abdou Illia.
TCP/IP Network and Firewall. IP Packet Protocol  1 ICMP packet  6 TCP packet  17 UDP packet.
Parts of example codes. Some useful structures ConnectionList “ constate.h ” TCPState “ tcpstate.h ” ConnectionToStateMapping “ constate.h ” IPHeader.
TCP connection my Computertelnet client web server remote computer 1 character per transmission * Telnet uses TCP connection * but Nagle's algorithm modifies.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
Chapter 3 Review of Protocols And Packet Formats
1 ELEN 602 Lecture 15 More on IP TCP. 2 byte stream Send buffer segments Receive buffer byte stream Application ACKs Transmitter Receiver TCP Streams.
Process-to-Process Delivery:
CIS 193A – Lesson10 Protecting Your Network. CIS 193A – Lesson10 Focus Question What information contained in packets can be used as matching criteria.
By Deepthi Reddy Ramya Balakumar Vandana Bhardwaj Simple Packet Filtering Firewall.
Midterm Review These slides contain 90% recycled content.
6.1. Transport Control Protocol (TCP) It is the most widely used transport protocol in the world. Provides reliable end to end connection between two hosts.
Network Architecture Models: Layered Communications School of Business Eastern Illinois University © Abdou Illia, Fall 2015 (September 14, 2015 ) Encapsulation.
Access Control List (ACL)
Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
Transmission Control Protocol
Beginning Network Security Monitor and control flow into and out of the LAN Ingress Egress Only let in the good guys Only let out the corp. business.
 network appliances to filter network traffic  filter on header (largely based on layers 3-5) Internet Intranet.
DoS Suite and Raw Socket Programming Group 16 Thomas Losier Paul Obame Group 16 Thomas Losier Paul Obame.
Decoding an IP Header (1)
MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.
EECS340 Recitation 2: Very helpful to your project Hongyu Gao 1.
Slide #1 CIT 380: Securing Computer Systems TCP/IP.
Breno de MedeirosFlorida State University Fall 2005 The IP, TCP, UDP protocols A quick refresher.
1 CSE 5346 Spring Network Simulator Project.
Transport Protocols.
Access Control List (ACL) W.lilakiatsakun. Transport Layer Review (1) TCP (Transmission Control Protocol) – HTTP (Web) – SMTP (Mail) UDP (User Datagram.
NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are still here.
Transport Layer1 TCP Connection Management Recall: TCP sender, receiver establish “connection” before exchanging data segments r initialize TCP variables:
FEE Control DIM (Distributed Information Management ) as communication layer between TPC/TRD and FEE control/monitoring application at ALICE.
Cisco I Introduction to Networks Semester 1 Chapter 7 JEOPADY.
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
TCP Selective Acknowledgement Options
Transmission Control Protocol (TCP)
Part 6 Transport Layer Transport Level Services TCP.
Transmission Control Protocol (TCP)
Process-to-Process Delivery
© 2003, Cisco Systems, Inc. All rights reserved.
TCP.
Extending Option Space Discussion Overview and its requirements
Reliable Transport CS 3700 Project 3.
Process-to-Process Delivery:
The IP, TCP, UDP protocols
Reliable Transport CS 3700 Project 3.
Figure 3-23: Transmission Control Protocol (TCP) (Study Figure)
TCP Protocol Analysis Access UMKC Home Page.
Network Architecture Models: Layered Communications
Parts of example codes Yan Gao Feb. 10, 2006.
Transport Layer 9/22/2019.
TCP Connection Management
Presentation transcript:

What to do in muxHandler()?

Get the headers  Use function MinetReceive to get the packet p.  Get the TCPHeader and IPHeader of p. You can use the function in class Packet. For example, FindHeader function. You can get the Tcpheader by using p.FindHeader(Headers::TCPHeader);

Find the connections  Extract information from the IPHeaders and TCPHeaders. For example, src ip & port and dest ip &port. For example, using iph.GetDestIP function.(suppose iph is the ip header)  Use the information above to find the connection the packet belongs in Clist. Clist is used for keeping all connections built. For example, using ConnectionList ::iterator cs = clist.FindMatching(c);// Specify c with src & dest information

Parse tcp header  Get the state of current connection. You may need to modify it based on the packet received. For example, using (*cs).state.GetState();  Get the flags of TCP header, using tcph.GetFlags(f). Then check whether it is SYN, ACK, FIN.. And do corresponding action based on current state.

For Example  if( IS_ACK(f) && IS_SYN(f) )  {  cout<<"SYN ACK packet Received. will have to send ACK packet"<<endl;  p.Print(cout);  if( state == SYN_SENT )  {  connstate.state.SetState(ESTABLISHED);  unsigned int newack,last_recvd;  tcph.GetAckNum(newack);  tcph.GetSeqNum(last_recvd);  connstate.state.SetLastAcked( newack );  connstate.state.SetLastRecvd( last_recvd );  connstate.timeout=Time() + ACK_TIMEOUT;  char *data1 = "ACTIVE:in active connection\n";  Buffer b(data1,strlen(data1));  Packet psh;  unsigned int old_time;  TCPOptions opt;  tcph.GetOptions(opt);  old_time = ntohl(*(int *)(opt.data+8));  craftSynPacket(&psh,connstate,PSH_ACK_HEADER,0,old_time);  psh.Print(cout);  MinetSend(mux,psh);  connstate.state.SetLastSent(connstate.state.GetLastSent());  status=STATUS;  MinetSend(sock,write);  }