GithubHelp home page GithubHelp logo

anuragdalvi / raw_sockets Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 5 KB

Constructed TCP and IP packets by bypassing Kernels TCP/IP stack, using Raw sockets to connect to a web server and download a web page. Implemented a packet sniffer to receive and parse the incoming packets and extract information to send a response. Handled 3-way handshake, sequence, acknowledgement numbers, window, timeout drops and duplicate packets.

Python 100.00%

raw_sockets's Introduction

Approach and Challenges:
1) We implemented Object Oriented approach in creating headers for TCP and IP,
The challenge was to change the information in TCP headers everytime a new
packet is sent. In order to change the TCP information in TCP headers by changing values of
attributes of the object created.

2) Another challenge was to parse the TCP headers in order to extract the
information from the TCP headers and use the information to create new
responses. We created another class to parse the information received in TCP
headers and used those objects that parse the information as arguments to
functions to create packets.

3) Another class was introduced using objects created from above classes. The
functions of this class would send syn, ack and send data by changing attributes
of the objects created from above classes.

4) In the main part of the code we used the objects created from above classes to
manage the requests, acks and data from the server.

5) In order to maintain the sequence of the data received we used dictionary
keys as the sequence numbers and data received corresponding to the
sequence numbers and sorted the dictionary.

6) From the HTTP reponse that we received we checked the status code using the
above functions and would only continue with the code only if it is
200 OK.

7) We set the initial congestion window to 1 and subthreshold to 1000 and
initiated the time at which ack was sent.

8) We also modify congestion window with every successful ack we receive and
reduce it to 1 for every packet drop. Also if we dont receive over 3 mins the
code exits.

7) Our condition to exit the code is when we get a fIN/ACK

raw_sockets's People

Contributors

anuragdalvi avatar

Stargazers

 avatar Vijay Nag avatar  avatar

Watchers

 avatar  avatar

Forkers

webclinic017

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.