cs518 packet handling in linux --gaurav dawra
DESCRIPTION
CS518 Packet Handling in Linux --Gaurav Dawra. 0. 0. Overview. Internetworking: Past and Present Overview TCP/IP and OSI Model Sockets Overview Internetworking: Past and Present Overview IP solutions: Routing Packet Forwarding Routing Vs Forwarding Address resolution Protocol (ARP) - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/1.jpg)
CS518 CS518 Packet Handling in LinuxPacket Handling in Linux
--Gaurav Dawra--Gaurav Dawra
![Page 2: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/2.jpg)
Internetworking: Past and Present OverviewInternetworking: Past and Present Overview TCP/IP and OSI ModelTCP/IP and OSI Model Sockets Overview Sockets Overview Internetworking: Past and Present OverviewInternetworking: Past and Present Overview IP solutions: IP solutions:
– RoutingRouting– Packet ForwardingPacket Forwarding– Routing Vs ForwardingRouting Vs Forwarding– Address resolution Protocol (ARP)Address resolution Protocol (ARP)
Wireless Networking : Brief OverviewWireless Networking : Brief Overview
Overview
![Page 3: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/3.jpg)
The ProblemThe Problem Before Internet: different packet-switching Before Internet: different packet-switching
networks (e.g., ARPANET)networks (e.g., ARPANET)– only nodes on the same network could communicateonly nodes on the same network could communicate
* source: RPI Institute , internet protocol
![Page 4: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/4.jpg)
The Internetworking ProblemThe Internetworking Problem Two nodes communicating across a Two nodes communicating across a
““network of networksnetwork of networks”… ”… – How to How to sendsend packets through this strange packets through this strange
medium ?medium ?
A B
* source: RPI Institute , internet protocol
Medium
Medium
![Page 5: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/5.jpg)
SolutionSolution
Network LayerRouters
* source: RPI Institute , internet protocol
![Page 6: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/6.jpg)
The IP Solution …The IP Solution …
IP layer routers & global addresses –IP layer routers & global addresses –right!!right!!
IP
IPIP
IP
* source: RPI Institute , internet protocol
![Page 7: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/7.jpg)
Before IPBefore IP
No network level abstraction: each new No network level abstraction: each new application has to be application has to be re-re-implemented implemented for for every every newnew network technology! network technology!
Telnet FTP NFS
Packetradio
Coaxial cable
Fiberoptic
Application
TransmissionMedia
HTTP
(FTP – File Transfer Protocol, NFS – Network File Transfer, HTTP – World Wide Web protocol)
* source: RPI Institute , internet protocol
![Page 8: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/8.jpg)
IPIP Key ideas: Key ideas:
– Abstraction:Abstraction: better than any better than anyany translation. Fewer, any translation. Fewer, simpler mappings.simpler mappings.
– Network-layer:Network-layer: efficient implementation, global addressing efficient implementation, global addressing
Telnet FTP NFS
Packetradio
Coaxial cable
Fiberoptic
Application
TransmissionMedia
HTTP
Intermediate Layer (IP)
* source: RPI Institute , internet protocol
![Page 9: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/9.jpg)
Internetworking: Past and Present OverviewInternetworking: Past and Present Overview TCP/IP and OSI ModelTCP/IP and OSI Model Sockets Overview Sockets Overview Internetworking: Past and Present OverviewInternetworking: Past and Present Overview IP solutions: IP solutions:
– RoutingRouting– Packet ForwardingPacket Forwarding– Routing Vs ForwardingRouting Vs Forwarding– Address resolution Protocol (ARP)Address resolution Protocol (ARP)
Wireless Networking : Brief OverviewWireless Networking : Brief Overview
Where are we?Where are we?
![Page 10: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/10.jpg)
TCP/IP (Transport Layer)TCP/IP (Transport Layer)Functions of Transport Layer-- Establishing End to End Connections-- Ensuring Data Reliability-- Providing Flow Control
![Page 11: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/11.jpg)
TCP/IP (Network Layer)TCP/IP (Network Layer)Internet layer
-- Send packets from a network node and have them arrive at the destination node independent of the path taken.
![Page 12: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/12.jpg)
TCP/IP LayerTCP/IP Layer
Application LayerApplication Layer
Transport LayerTransport LayerTransport LayerTransport Layer
Internet LayerInternet LayerInternet LayerInternet Layer
Network Interface LayerNetwork Interface LayerNetwork Interface LayerNetwork Interface Layer
Internet LayerIPIP ICMPICMP IGMPIGMP ARPARP
Network Interface Layer
EthernetEthernetATMATM
Transport LayerUDPUDPTCPTCP
Application Layer
FTPFTPHTTPHTTP
![Page 13: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/13.jpg)
OSI ModelOSI Model
Application LayerApplication LayerApplication LayerApplication Layer
Presentation LayerPresentation LayerPresentation LayerPresentation Layer
Session LayerSession LayerSession LayerSession Layer
Transport LayerTransport LayerTransport LayerTransport Layer
Network LayerNetwork LayerNetwork LayerNetwork Layer
Data Link LayerData Link LayerData Link LayerData Link Layer
Physical LayerPhysical LayerPhysical LayerPhysical Layer
![Page 14: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/14.jpg)
Comparing the OSI Model and Comparing the OSI Model and TCP/IP ModelTCP/IP Model
![Page 15: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/15.jpg)
Where are we?Where are we?
Internetworking: Past and Present OverviewInternetworking: Past and Present Overview TCP/IP and OSI ModelTCP/IP and OSI Model Sockets Overview Sockets Overview IP solutions: IP solutions:
– RoutingRouting– Packet ForwardingPacket Forwarding– Routing Vs ForwardingRouting Vs Forwarding– Address resolution Protocol (ARP)Address resolution Protocol (ARP)
Wireless Networking: Brief OverviewWireless Networking: Brief Overview
![Page 16: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/16.jpg)
Overall Picture (One View)Overall Picture (One View)
ROUTING
![Page 17: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/17.jpg)
Internetworking: Past and Present OverviewInternetworking: Past and Present Overview TCP/IP and OSI ModelTCP/IP and OSI Model IP addressing IP addressing Sockets Overview Sockets Overview IP solutions: IP solutions:
– IP Packet ForwardingIP Packet Forwarding– RoutingRouting– Routing Vs ForwardingRouting Vs Forwarding– Address resolution Protocol (ARP)Address resolution Protocol (ARP)
Wireless Networking : Brief OverviewWireless Networking : Brief Overview
Where are we Now?Where are we Now?
![Page 18: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/18.jpg)
TCP/IP ModelTCP/IP Model
NetworkDatalink
TransportRouter
Bridge/SwitchRepeater/Hub
Application
NetworkDatalink
Transport
Application
Broadcast Domain
![Page 19: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/19.jpg)
Forwarding:Forwarding: select an select an output portoutput port based on based on destination address and destination address and routing tablerouting table
Routing:Routing: process by which process by which routing tablerouting table is is built..built..… … so that the series of so that the series of local forwarding decisionslocal forwarding decisions
takes the packet to the destination with very high takes the packet to the destination with very high probabilityprobability
… … the path chosen/allotted to the packet is the path chosen/allotted to the packet is efficient efficient in in some sense… Filtering of packetssome sense… Filtering of packets
RoutingRouting vs. vs. ForwardingForwarding
![Page 20: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/20.jpg)
IP Forwarding IP Forwarding
Direct Connectivity Indirect Connectivity
-- Same Network --Not on the Same Network
* source: RPI Institute , internet protocol
![Page 21: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/21.jpg)
IP ForwardingIP Forwarding(direct connectivity)(direct connectivity)
Source & Destination in same network Source & Destination in same network ((direct connectivitydirect connectivity))
– Recognize that destination IP address is on Recognize that destination IP address is on same network. same network.
– Find the Find the destinationdestination LAN address. LAN address. – Send IP Send IP packet encapsulatedpacket encapsulated in LAN frame in LAN frame
directly to the destination LAN addressdirectly to the destination LAN address– IP in MAC/LAN FRAME: Encapsulation => IP in MAC/LAN FRAME: Encapsulation =>
source/destination IP addresses don’t changesource/destination IP addresses don’t change
![Page 22: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/22.jpg)
IP Forwarding IP Forwarding (indirect connectivity)(indirect connectivity)
B) B) Source & Destination in different Source & Destination in different networks (networks (indirect connectivityindirect connectivity))– Recognize that destination IP address isRecognize that destination IP address is NOT NOT
on same network. on same network. – Look upLook up destination IP address in a destination IP address in a
(forwarding) table to find a match, (forwarding) table to find a match, called the called the next hop router IP address. next hop router IP address.
– Send packet encapsulated in a LAN frame to Send packet encapsulated in a LAN frame to the LAN address corresponding to the IP the LAN address corresponding to the IP address of the next-hop router. address of the next-hop router.
![Page 23: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/23.jpg)
Kernel IP routing tableKernel IP routing table Destination Gateway Genmask Flags Metric Ref Use IfaceDestination Gateway Genmask Flags Metric Ref Use Iface 153.90.192.0 * 255.255.248.0 U 0 0 0 eth0153.90.192.0 * 255.255.248.0 U 0 0 0 eth0 5.0.0.0 * 255.0.0.0 U 0 0 0 srcr5.0.0.0 * 255.0.0.0 U 0 0 0 srcr 6.0.0.0 * 255.0.0.0 U 0 0 0 wlan06.0.0.0 * 255.0.0.0 U 0 0 0 wlan0 169.254.0.0 * 255.255.0.0 U 0 0 0 eth0169.254.0.0 * 255.255.0.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo127.0.0.0 * 255.0.0.0 U 0 0 0 lo default epgwy192.msu.mo 0.0.0.0 UG 0 0 0 eth0default epgwy192.msu.mo 0.0.0.0 UG 0 0 0 eth0
Forwarding TableForwarding TableCommand: ‘route’
![Page 24: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/24.jpg)
AddressingAddressing [1][1] How to find if destination is in the same How to find if destination is in the same
network ?network ?– IP address = IP address = network IDnetwork ID + + host IDhost ID. .
-- If the Source and Destination ID’s Match (Same -- If the Source and Destination ID’s Match (Same Network)Network)
--If not, We need Router--If not, We need RouterNetwork Host
Boundary
192.168.0.10 Netmask 255.255.255.010.1.2.1 Netmask 255.0.0.0
![Page 25: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/25.jpg)
Address ResolutionAddress Resolution
How to find the LAN address How to find the LAN address corresponding to an IP address ?corresponding to an IP address ?– Address Resolution Problem.Address Resolution Problem. – Solution: ARP, RARP (Solution: ARP, RARP (I will come back to thisI will come back to this))
![Page 26: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/26.jpg)
IP Forwarding: Example IP Forwarding: Example ScenarioScenario
IP datagram: IP datagram:
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
A
B
E
miscfields
sourceIP addr
destIP addr data
datagram remains unchanged, as it travels source to destinationaddr fields of interest here
routing table in ADest. Net. next router Nhops
223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2
* source: RPI Institute , internet protocol
![Page 27: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/27.jpg)
IP Forwarding (Direct)IP Forwarding (Direct)
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
A
B
E
Starting at A, given IP datagram addressed to B:look up net. address of Bfind B is on same net. as Alink layer will send datagram directly to B inside link-layer frame
B and A are directly connected
Dest. Net. next router Nhops
223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2
miscfields 223.1.1.1 223.1.1.3 data
* source: RPI Institute , internet protocol
![Page 28: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/28.jpg)
IP Forwarding (Indirect): Step 1IP Forwarding (Indirect): Step 1
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
A
B
E
Dest. Net. next router Nhops
223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2
Starting at A, dest. E:look up network address of EE on different network
A, E not directly attached
routing table: next hop router to E is 223.1.1.4 link layer sends datagram to router 223.1.1.4 inside link-layer framedatagram arrives at 223.1.1.4 continued…..
miscfields 223.1.1.1 223.1.2.2 data
* source: RPI Institute , internet protocol
![Page 29: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/29.jpg)
The Internet Network layerThe Internet Network layer
routingtable
Host, router network layer functions:Host, router network layer functions:
IP protocol•addressing conventions•datagram format•packet handling conventions
ICMP protocol•error reporting•router “signaling”
Transport layer: TCP, UDP
Link layer
physical layer
Networklayer
* source: RPI Institute , internet protocol
![Page 30: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/30.jpg)
Peek into source CodePeek into source Code(Sending Out)(Sending Out)
![Page 31: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/31.jpg)
Peek into source CodePeek into source Codeipv4/net/ip_output.cipv4/net/ip_output.c
-- Builds and Send-- Checks the route -- IP Checksum-- IP Header
IP_LOCAL_OUT
ip_output()Checks for NATNetwork Address Translation
ip_finish_output()ip_finish_output2()Call hh or dst output routine
Drop On Wire
![Page 32: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/32.jpg)
Peek into source Code:Peek into source Code: ( Packet Receiving: ( Packet Receiving: ip_input.cip_input.c))
Checks for Protocol
IP
TCP
ROUTING
![Page 33: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/33.jpg)
Peek into source Code:Peek into source Code: ( Packet Receiving: ( Packet Receiving: ip_input.cip_input.c))Input Queue
ARP ip_rcv()IP headerCheck Sum
IP_PREROUTING
ip_rcv_finish () : ipv4/ip_input.c-- Calls ip_route_input() to route-- Calls ip_forward()
ip_forward()ip_forward.c-- Check TTL-- Flag Check
icmp.c (Error)Local deliveryBingo!! Its mine
DROPOther Host
Bingo!!Drop On Wire
![Page 34: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/34.jpg)
Where are we?Where are we?
Internetworking: Past and Present OverviewInternetworking: Past and Present Overview TCP/IP and OSI ModelTCP/IP and OSI Model IP addressing IP addressing Sockets Overview Sockets Overview Internetworking: Past and Present OverviewInternetworking: Past and Present Overview IP solutions: IP solutions:
– IP Packet ForwardingIP Packet Forwarding– RoutingRouting– Routing Vs ForwardingRouting Vs Forwarding– Address resolution Protocol (ARP)Address resolution Protocol (ARP)
Wireless Networking: Brief OverviewWireless Networking: Brief Overview
![Page 35: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/35.jpg)
Question: Why ARP?Question: Why ARP?
Do Do Binding:Binding:
--Association between a IP address and a --Association between a IP address and a hardware address (one for every device) is hardware address (one for every device) is called a called a binding.binding.
![Page 36: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/36.jpg)
ARP TechniquesARP Techniques
Table Lookup Dynamic Binding :ARP
Pictorial View of ARP
* source: RPI Institute , internet protocol
![Page 37: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/37.jpg)
ARP techniques (cont.)ARP techniques (cont.) 1: Table Lookup:1: Table Lookup:
Searching or indexing to get MAC addressesSearching or indexing to get MAC addresses– Similar to lookup in /etc/hosts for namesSimilar to lookup in /etc/hosts for names– Problem: change Ethernet card => change tableProblem: change Ethernet card => change table
IP Address MAC Address192.168.0.1 0A:4B:00:00:07:08192.168.0.2 0B:4B:00:00:07:00192.168.0.3 0A:5B:00:01:01:03
![Page 38: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/38.jpg)
ARP techniques (Continued)ARP techniques (Continued) 2.2. Dynamic Binding: ARPDynamic Binding: ARP
– The host The host broadcastsbroadcasts a request: a request: “What is the MAC address of 127.123.115.08?”“What is the MAC address of 127.123.115.08?”
– The host whose IP address is 127.123.115.08 The host whose IP address is 127.123.115.08 replies back: “The MAC address for replies back: “The MAC address for 127.123.115.08 is 8A-5F-3C-23-45-56127.123.115.08 is 8A-5F-3C-23-45-561616””
– ARP responses cached; LRU + Entry Timeout ARP responses cached; LRU + Entry Timeout
These two methods are allowed in TCP/IP These two methods are allowed in TCP/IP networks.networks.
![Page 39: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/39.jpg)
Source codeSource code
Queue
ARP
arp_send(): arp.c-- Check Device Supports ARP-- Allocate Buffer-- fills Header/ARP Information-- calls dev_queue_xmit() to send
![Page 40: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/40.jpg)
How Does all of this Fit together?How Does all of this Fit together?
Input Queue
ARP ip_rcv()
IP_PREROUTING
ip_forward()
icmp.c (Error)
ip_rcv_finish ()
Local Delivery
Local IP Services
Build IP Packet
IP_LOCAL_OUT
ip_output()
Physical Medium
ip_finish_output()
![Page 41: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/41.jpg)
Internetworking: Past and Present OverviewInternetworking: Past and Present Overview TCP/IP and OSI ModelTCP/IP and OSI Model IP addressing IP addressing Sockets Overview Sockets Overview Internetworking: Past and Present OverviewInternetworking: Past and Present Overview IP solutions: IP solutions:
– RoutingRouting– Packet ForwardingPacket Forwarding– Routing Vs ForwardingRouting Vs Forwarding– Address resolution Protocol (ARP)Address resolution Protocol (ARP)
Wireless Networking: Brief OverviewWireless Networking: Brief Overview
Where are we?
![Page 42: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/42.jpg)
Wireless NetworksWireless Networks
-- The use of infra-red or radio frequency signals to share information and resources between devices
Wireless State of ArtWireless State of Art
IEEE 802.11b(wi-fi)•2.4GHz•11mbps
IEEE 802.11g• 2.4GHz• 54mbps•Compatible with 802.11b
IEEE 802.11a• 5GHz• 54mbps
IEEE 802.16aWiMaX• 30 Mbps• 30 Miles
![Page 43: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/43.jpg)
Types of WLANTypes of WLAN(Wireless LAN)(Wireless LAN)
Infrastructure modeInfrastructure mode
* Source British Educational Communications and technology agency
![Page 44: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/44.jpg)
Ad-hoc ModeAd-hoc Mode
Each NODE is HOST and ROUTER
Linux 2.4.20HOST, ROUTER, NATDHCP Server.
We Set up a FIVE NODE Multi Hop Ad-Hoc Network
Wireless Card is configured using -- HostAP driver and pcmcia-cs package
![Page 45: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/45.jpg)
What is ‘Software Router’What is ‘Software Router’--Each Node in our Network is:--Each Node in our Network is:
-- A Router in a Computer (Our Case : Linux 2.4.20 and 2.4.26 Machines )-- Program that receives, processes and forwards packets to the next node-- We are using CLICK MODULAR ROUTER
(developed at MIT)-- Features of Click:• High level programming interface to the developer• Hides Kernel Complexities• Easily installed and configured• Provide flexibility to writes own Elements and eventually Combines these elements to write any Ad Hoc Routing Protocol
![Page 46: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/46.jpg)
Pictorial View ofPictorial View of Each Click Router Node Each Click Router Node
5.0.0.0 srcr Interface6.0.0.0 wlan0 Interface
Private LAN attached to HOSTEth0 Interface: 192.168.0.1
153.90.196.95
![Page 47: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/47.jpg)
Click.config File ExampleClick.config File ExampleFromDevice(eth0) -> Print -> ToDevice(wlan0);
1. FromDevice(eth0): Get a packet from eth0 interface2. Print: Print the packet ( can see using ‘dmesg’)3. ToDevice(wlan0): Send the packet to eth1 interface=========================================
Start CLICK by loading Click.config file to /click/configCommand:dawra@roofnet$insmod click.o (Kernel Side Module made for Click)dawra@roofnet$ cp click.config /click/config
Check out:http://www.pdos.lcs.mit.edu/click
Demonstration
![Page 48: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/48.jpg)
Internetworking: Past and Present OverviewInternetworking: Past and Present Overview TCP/IP and OSI ModelTCP/IP and OSI Model Sockets Overview Sockets Overview Internetworking: Past and Present OverviewInternetworking: Past and Present Overview IP solutions: IP solutions:
– RoutingRouting– Packet ForwardingPacket Forwarding– Routing Vs ForwardingRouting Vs Forwarding– Address resolution Protocol (ARP)Address resolution Protocol (ARP)
Wireless Networking : An OverviewWireless Networking : An Overview
SummarySummary
![Page 49: CS518 Packet Handling in Linux --Gaurav Dawra](https://reader036.vdocuments.mx/reader036/viewer/2022062422/56813995550346895da12ad7/html5/thumbnails/49.jpg)
What are the Resources?What are the Resources?
• MIT Click Modular Router : http://www.pdos.lcs.mit.edu/click• Roofnet MIT testbed: http://www.pdos.lcs.mit.edu/roofnet/design• Computer Networking: Andrew S. Tanenbaum• Internet Protocols Coursework : RPI institute• Linux Source Code : http://lxr.linux.no/source/• Linux Networking Documentation : http://www.kernelnewbies.org/• Linux Documentation Project : http://www.tldp.org/• Linux Kernel : www.kernel.org