Upload
mariah-cummings
View
213
Download
1
Embed Size (px)
Citation preview
Networking
Colin Alworth
May 26, 2006
Quick Review
• IP address: four octets
• Broadcast addresses – IP addresses use all 1’s for the host bits, and
whatever network bits are needed– MAC addresses are all 1’s
(FF:FF:FF:FF:FF:FF)
Packet Makeup
• Encapsulation (Ethernet, SLIP)– IPX– IPv4 (64k)
• TCP– http, ftp, icmp
• UDP
• DHCP
• ARP
OSI Model: All People Seem To Need Data Processing
• Application
• Presentation
• Session
• Transport
• Network
• Data Link
• Physical
Linux
• Uses this model
• Based on the BSD TCP/IP network stack
Linux Commands
• ifconfig – sets up interfaces• route – defines routing information• netstat – displays network statistics• tcpdump – outputs the incoming packets
Adding Devices to a Network
• Any OS will need information like:– IP Address– Subnet Mask– DNS Server– Gateway Address
DHCP
• Dynamic Host Configuration Protocol • Based on BOOTP – not so dynamic• Gets all of the network info from a single server• Can be different on every distro
– Debian – edit the file /etc/network/interfaces
– Another option – /etc/dhclient.conf, or the command dhclient
Looking at the kernel
• net directory holds the code for networking
• Why have networking code in the kernel?
Simple diagram
Complex Diagram
Kernel Issues
• IP – Checksums: done in software– Packet mangling, unmangling– net/ipv4/ip_input.c
• Security?– Root access needed for many operations– SSL, and tunneling
Example in UML
• Create a new interface
• Give user access to interface
• Run UML with eth0=tuntap,device• No routing or connections to internet• wget, ping
Making changes
• net/ipv4/ip_input.c:260• Avoiding mangled packets
• Testing, running
Next step: IPv6
• IPv4 has 4.3×109 (4.3 billion) addresses
• IPv6 supports 3.4×1038 addresses
• Bigger packet size limits (jumbograms)
• Routing performance
• Notation: eight groups of four hex digits
• Same network/host differences
• No broadcast – use flags instead
Bibliography
• http://user-mode-linux.sourceforge.net/networking.html
• http://lxr.linux.no/• http://www.tldp.org/HOWTO/NET3-4-
HOWTO.html• http://cs.uml.edu/~cgould/#Networking• http://cisco.netacad.net - name and password
required• http://en.wikipedia.org/wiki/IPv6
Links to start with
• http://news.netcraft.com/archives/web_server_survey.html
• http://lxr.linux.no/