csc458-routes-nat's Introduction
Overview of the Code: Files Changed: ------------- sr_router.c sr_utils.c sr_arpcache.c Summary: -------- sr_router.c The sr_handlepacket function inside sr_router handles all the incoming ARP and ICMP packets. sr_handlepacket sorts the packets into either ARP or ICMP packets and processes the functions seperately. We followed the logic provided under the tutorial slide to process an ARP and IP packet seperately. For incoming ARP requests, we will send the ARP reply immediately. Otherwise, for all IP packets, we will create the neccessary packet in the logic. Afterwards, we will check if we have the IP resolved in a cache. If it exists, we will encap the packet inside an Ethernet packet and send the packet right away, otherwise, we will cache the packet into an ARP cache and have the ARP sweep function send boardcasts to attempt to resolve the host. Similarly, for ARP replies, we will cache the reply and send all outstanding packets immediately. sr_utils.c We added additional utilities functions such as to grab the ip_packet header out of a packet or the find the length of an IP packet. We kept these functions in the sr_utils file to reduce code reduency but also to increase readibility sr_arpcache.c We added the sr_arpcache sweep function to send ARP broadcast requests to resolve the MAC addresses for cached ethernet packets. However, if an ARP request has been sent 5 times, we will send all outstanding packets back to the client and delete the cache.
csc458-routes-nat's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.