17
Networking Colin Alworth May 26, 2006

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

Embed Size (px)

Citation preview

Page 1: 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

Networking

Colin Alworth

May 26, 2006

Page 2: 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

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)

Page 3: 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

Packet Makeup

• Encapsulation (Ethernet, SLIP)– IPX– IPv4 (64k)

• TCP– http, ftp, icmp

• UDP

• DHCP

• ARP

Page 4: 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

OSI Model: All People Seem To Need Data Processing

• Application

• Presentation

• Session

• Transport

• Network

• Data Link

• Physical

Page 5: 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

Linux

• Uses this model

• Based on the BSD TCP/IP network stack

Page 6: 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

Linux Commands

• ifconfig – sets up interfaces• route – defines routing information• netstat – displays network statistics• tcpdump – outputs the incoming packets

Page 7: 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

Adding Devices to a Network

• Any OS will need information like:– IP Address– Subnet Mask– DNS Server– Gateway Address

Page 8: 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

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

Page 9: 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

Looking at the kernel

• net directory holds the code for networking

• Why have networking code in the kernel?

Page 10: 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

Simple diagram

Page 11: 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

Complex Diagram

Page 12: 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

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

Page 13: 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

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

Page 14: 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

Making changes

• net/ipv4/ip_input.c:260• Avoiding mangled packets

• Testing, running

Page 15: 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

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

Page 16: 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

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

Page 17: 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

Links to start with

• http://news.netcraft.com/archives/web_server_survey.html

• http://lxr.linux.no/