Upload
lambert-freeman
View
241
Download
7
Tags:
Embed Size (px)
Citation preview
CIT 384: Network Administration Slide #1
CIT 384: Network Administration
IP
CIT 384: Network Administration Slide #2
Topics
1. Network Layer
2. IP Packets
3. IP Addresses
4. Subnets
5. IP Routing
6. ARP and DHCP
CIT 384: Network Administration Slide #3
Routing
• The primary function of the network layer is routing.
• IP is the widely used network layer protocol.
• IP routing relies on the structure of IP addresses.
CIT 384: Network Administration Slide #4
Routing Logic
PC1: If host on same Ethernet, send; otherwise, send to gateway router.
R1, R2: Lookup destination in route table and forward packet to specified router.
R3: Lookup destination in route table and send to local Ethernet.
CIT 384: Network Administration Slide #5
Network Layer Interaction with Data Link Layer
PC1: Network layer encapsulates data in Ethernet frame.
R1: Extract IP packet from Ethernet frame, and encapsulate in HDLC frame to send to R2.
R2: Extract IP packet from HDLC frame and encapsulate in FR frame.
R3: Extract IP packet from FR frame and encapsulate in Ethernet frame.
CIT 384: Network Administration Slide #6
IP Packet Header
CIT 384: Network Administration Slide #7
IP Header
Protocol version: IPv4
Header length: 5-60 32-bit words
Type of service (TOS):– 3-bit precedence (ignored today)– 4 TOS bits (min delay (telnet), max throughput
(ftp), max reliability, min monetary cost)– unused 0 bit
CIT 384: Network Administration Slide #8
IP Header
Total length: length of IP datagram (bytes)– maximum size: 65535 bytes– large packets fragmented at data link layer.– small packets may be padded to minimum length.
TTL: upper limit on number of router hops.Protocol: which protocol supplied packet data.Header checksum: IP header checksum
CIT 384: Network Administration Slide #9
IP Fragments
IP packets may be fragmented by routers for transmission across different media.– Max IP packet size: 65536– Max Ethernet packet size: 1500
IP headers contain fragment data:– Don’t Fragment Flag: 0=allowed, 1=don’t– More Fragments Flag: 0=last, 1=more fragments– Identification: identifies single packet for
reassembly.– Fragment Offset: where contents of fragment go.
CIT 384: Network Administration Slide #10
IP Addresses
32-bit integersOne for each network interface.Dotted decimal notation: ii.jj.kk.ll
172 . 16 . 254 . 1
10101100 00010000 11111110 00000001
1 byte
32 bits = 4 bytes
CIT 384: Network Administration Slide #11
Grouping IP Addresses
Groups of consecutive IP addrs are called networks.
Routing table would only need 3 entries below.
CIT 384: Network Administration Slide #12
Network and Host Parts
IP addresses are divided into two parts– Network ID (like zip code)– Host ID (like street address)
Network ID Host ID
Two special IP addresses– Network address (e.g. 130.4.0.0)– Broadcast address (e.g. 130.4.255.255)
CIT 384: Network Administration Slide #13
Address ClassesClass A: 0.0.0.0-127.255.255.255
8-bit net ID, 24-bit host ID224 – 2 hosts per network; 126 networks
Class B: 128.0.0.0-191.255.255.25516-bit net ID, 16-bit host ID216 – 2 hosts per network; 16,384 networks
Class C: 192.0.0.0-223.255.255.25524-bit net ID, 8-bit host ID(28 – 2) = 254 hosts per network; 2,097,152 networks
Class D: 224.0.0.0-239.255.255.25528-bit multicast group ID
Class E: 240.0.0.0-255.255.255.255Reserved for future use
CIT 384: Network Administration Slide #14
CIT 384: Network Administration Slide #15
Assigning Addresses
ICANN assigns network numbers.– Internet Corporation for Assigned Network
Numbers.– ICANN gives authority to regional orgs, e.g.
ARIN (American Registry for Internet Numbers)– Typically to ISPs, universities, corporations.
ISP assigns IP addresses within network
CIT 384: Network Administration Slide #16
Addressing without Subnetting
CIT 384: Network Administration Slide #17
Why do we need subnets?
• Non-subnet design requires– 6 class B address spaces.– Each class B has 65,534 IP addresses
• Even if we assume many more PCs exist, some networks are drastically underutilized.– 150.6 only has 2 IP addresses (routers)
CIT 384: Network Administration Slide #18
Addressing with Subnets
CIT 384: Network Administration Slide #19
IP Addresses with Subnets
Route on network + subnet part of address.
CIT 384: Network Administration Slide #20
IP Routing
CIT 384: Network Administration Slide #21
Host Routing
1. If destination IP address on same subnet, send the packet directly to dest.
2. Otherwise, send packet to default gateway router.
CIT 384: Network Administration Slide #22
Router Logic
1. Check data-link FCS field for errors. Discard packet if an error detected.
2. Extract IP packet and discard data link header and trailer.
3. Compare packet’s destination IP address with routing table, and find route that matches the address. This route identifies the outgoing interface of router.
4. Encapsulate IP packet inside a new data link header and trailer appropriate for outgoing interface, and forward the frame.
CIT 384: Network Administration Slide #23
Routing Example
PC1 sending a packet to PC2.1. PC1 to R1.
2. R1 to R2.
3. R2 to R3.
4. R3 to PC2.
CIT 384: Network Administration Slide #24
Routing Example
CIT 384: Network Administration Slide #25
Routing Table
Where to send an IP packet to?Use a table lookup: routing tableSearch Process:
1. Search for a matching host address.2. Search for a matching network address.3. Search for a default route.
No route to destination: Host or network unreachable error if search fails.
CIT 384: Network Administration Slide #26
Routing Tablest361m13 (10.1.0.90) > netstat –rn
Routing Table: IPv4Destination Gateway Flags Ref Use Int------------- -------------------- ----- -----10.1.0.0 10.1.0.90 U 1 4977 hme0224.0.0.0 10.1.0.90 U 1 0 hme0default 10.1.0.1 UG 1 66480 127.0.0.1 127.0.0.1 UH 6 798905 lo0
CIT 384: Network Administration Slide #27
Routing Table
Destination: final destination host/networkGateway: next host in route to destinationFlags
U: Route is upG: Route is to a gateway (router)H: Route destination is a host (not a network)D: Route created by a redirectM: Route modified by a redirect
CIT 384: Network Administration Slide #28
Routing Table
10.1.0.0direct access to local subnet
224.0.0.0multicast route
defaultforward packets to router at IP 10.1.0.1
127.0.0.1loopback
CIT 384: Network Administration Slide #29
Routing Table SourcesManual (static) routes
Added with the route command.
ICMP redirects can alter routesRouter sends ICMP redirect when packet should’ve been
sent to another router.
Routing protocolsRouters exchange routes with each other using special
routing protocols.
Full internet router tables contain ~30,000 routes.
Source routingSender includes routing info in packet header.
CIT 384: Network Administration Slide #30
IP Routing Protocol Goals
1. Dynamically learn and fill routing table with a route to all subnets in network.
2. If more than one route available, place the best route in the routing table.
3. Replace lost routes with the best available route as soon as possible.
4. Prevent routing loops.
CIT 384: Network Administration Slide #31
Routing Protocol Procedure
1. Add a route to table for each directly connected subnet.
2. Tell neighbors about all routes in its routing table, including both directly connected routes and routes learned from other routers.
3. After learning a new route from neighbor, add that route to the table.
CIT 384: Network Administration Slide #32
Routing Protocol Example
1. R3 learns directly connected subnet 150.150.4.0 to E0.
2. R3 sends update to R2, so R2 adds.
3. R2 sends update to R1, so R1 adds route for 150.150.4.0 with outgoing interface of S0, the interface it learned from.
CIT 384: Network Administration Slide #33
Address Translation: DNS and ARP
Hannah wants to send packet to Jessie, but doesn’t know destination IP or MAC addrs.
Solution: address translation Jessie to IP address via DNS IP address to MAC address via ARP
CIT 384: Network Administration Slide #34
DNS
Domain Name ServiceTranslates names to IP addresses and vice-versa.
CIT 384: Network Administration Slide #35
ARP
Address Resolution Protocol1. Broadcast request for MAC address for dest IP.
2. Owner of dest IP replies with MAC address.
3. Cache address so don’t have to ARP for every packet.
CIT 384: Network Administration Slide #36
ARP Example
sftp zappa.nku.edu
1. Obtains IP address from DNS.2. sftp asks TCP to connect to IP address3. TCP sends connection request to zappa using an IP
datagram4. Sending host emits ARP broadcast, asking for MAC
address of given IP address5. Destination host’s ARP layer receives broadcast, answers
with an ARP reply w/ IP->MAC mapping6. Sending host constructs Ethernet frame with destination
MAC address containing IP datagram7. Sending host sends IP datagram
CIT 384: Network Administration Slide #37
ARP Cache
st361m13 (10.1.0.90) > arp -a
Net to Media Table: IPv4Device IP Address Phys Addr ------ -------------------- ------------------hme0 at_elan.lc3net 00:00:a2:cb:28:5ehme0 10.1.0.79 00:e0:cf:00:0e:92hme0 st361m13 08:00:20:d8:e0:07hme0 10.1.7.103 00:90:27:b6:b5:e5hme0 10.1.0.139 00:e0:cf:00:15:bd
CIT 384: Network Administration Slide #38
ARP Features
Proxy ARP– Router can answer ARP requests on network B
for a host on network A with its own MAC address since host A cannot see broadcast and B cannot send directly to A.
Gratuitous ARP– Host sends ARP for own IP address at boot.– No reply should be received.– Network misconfiguration if reply received.
CIT 384: Network Administration Slide #39
DHCP
Dynamic Host Configuration Protocol provides: IP address Netmask Gateway router DNS servers
CIT 384: Network Administration Slide #40
ICMP (Internet Control Message Protocol)
Network layer protocol encapsulated in IP– Communicates error messages and exceptions.– Messages handled by either IP or TCP/UDP.
IP Header (20 bytes) ICMP Message
8-bit type 8-bit code 16-bit checksum
Contents (always
depend contains
on type and code
IP header + 8 data bytes)
CIT 384: Network Administration Slide #41
ICMP Message Types
Type 0: echo (ping) replyType 3: destination unreachableType 4: source quenchType 5: redirectType 8: echo (ping) requestType 9, 10: router advertisement, solicitationType 11: time (TTL) exceededType 12: parameter (header) problemType 13: timestampType 14: timestamp replyType 15, 16: information request, reply
CIT 384: Network Administration Slide #42
References1. James Boney, Cisco IOS in a Nutshell, 2nd edition,
O’Reilly, 2005. 2. Cisco, Cisco Connection Documentation,
http://www.cisco.com/univercd/home/home.htm3. Cisco, Internetworking Basics,
http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/introint.htm
4. Wendell Odom, CCNA Official Exam Certification Library, 3rd edition, Cisco Press, 2007.
5. Priscilla Oppenheimer and Joseph Bardwell, Troubleshooting Campus Networks, Addison-Wesley, 2002.
6. W. Richard Stevens, TCP/IP Illustrated, Addison-Wesley, 1994.