Outline
IP Header
{\tiny
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| HLen |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Time to Live | Protocol | Header Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
}
IP Header
- all fields are big-endian
- version number must be first field
- Type of Service is defined but not widely used
- Total Length is needed for protocols that may pad the packet
(e.g. ethernet)
- header length used for options
- TTL/Time To Live (really a "maximum hop count") kills packet
in case of routing errors
- protocol: 1 (ICMP), 6 (TCP), 17 (UDP)
IP Header
- header checksum (RFC 1071,
http://www.cis.ohio-state.edu/htbin/rfc/rfc1071.html) only protects
header
- source address might be useful for responding
- fragmentation fields allow us to send packets larger than
the underlying network's MTU:
- packet ID tells us which packet this is for
- fragment offset ( * 8) is the byte offset for this fragment
- flags tell us:
- don't fragment
- this is the last fragment
- minimum MTU for carrying IP is 576 bytes
ICMP
- Internet Control Message Protocol
- logically on top of IP (protocol value 1)
- in practice, it is a part of IP
- functions:
- connectivity testing ("ping" uses the ICMP echo messages).
- error reporting (packet dropped because: ...)
- basic routing (redirect, default router information, address masks)
- every host on the Internet implements ICMP,
which is why ping is useful.
Traceroute
- one possible error reported using ICMP is "Time Exceeded", if the TTL
field reaches 0.
- if we send a packet with TTL=1, the first router along the path
will decrement it to zero and send a time-exceeded error
- if we send a packet with TTL=2, the second router along the path
will decrement it to zero and send a time-exceeded error
- if we keep track of which routers send us ICMP packets,
we will know what route our packets are following.
Ping
- ping sends ICMP echo request packets
- echo request has space for:
- sequence number
- identifier
- application-level data
- some versions of ping place the "time sent" in the application data,
making it easy to measure the round-trip-time
- most versions of ping print the TTL in received packets, which
gives an indication of the number of hops the packet has crossed (60, 64, 30,
15, 255 are common starting values)
Domain Names
- address levels:
- Hardware (Ethernet, FDDI, ATM): typically 48-64 bits
- Network/Internet (IP): 32-128 bits
- ASCII (Domain Name System): variable length
- Conversions:
- ARP gives Hardware address given Network address
- DNS Resolution gives Network address given ASCII Domain Name
DNS -- Examples
- uhics.ics.hawaii.edu
- zilch.ics.hawaii.edu
- www.stanford.edu
- prep.ai.mit.edu
- On Unix, gethostbyname does DNS resolution
- What calls are available on other systems?
- On Unix, nslookup does DNS resolution
- What commands are available on other systems?
Naming System Principles
- Distributed Administration
- Hierarchical
- Resolution Mechanism
- Uniform Data Format
DNS Hierarchy: root
- US root domains: .edu, .com, .net, .gov, .mil, org, ...
- International root domains: .ca, .jp, .uk, .it, .fr, .ch
- What other root domains can you name?
- The actual root is "."
- The full DNS name of uhics is " uhics.ics.hawaii.edu."
DNS Hierarchy: delegation
Netscape is free to allocate all names ending with .netscape.com.
The military is free to allocate all names ending with .mil.
Japan is free to allocate all names ending with .jp.