Presentation is loading. Please wait.

Presentation is loading. Please wait.

COS 338 Day 15.

Similar presentations


Presentation on theme: "COS 338 Day 15."— Presentation transcript:

1 COS 338 Day 15

2 DAY 15 Agenda Capstone Proposal Overdue
3 accepted, 3 in mediation Capstone progress reports still overdue I forgot to mark in calendar so I will grant a reprieve Lab 4 write-up corrected 2 A’s, 1 B, 2 F’s and 1 non-submit Again grades are determined by effort Lab 5 Due November 3 Assignment 5 Posted Due November 7 Should be on assignment 7 (I suspect that we will have only 8-9 assignments) Today we will discussing TCP/IP Lab 6 on Thursday

3 TCP/IP Internetworking
Chapter 8 Panko’s Business Data Networks and Telecommunications, 5th edition Copyright 2005 Prentice-Hall

4 Perspective Chapters 4 & 5 covered single LANs
Chapter 7 covered single WANs Most corporations have intranets that combine multiple LANs and WANs Most intranets use TCP/IP standards So does the global Internet Chapter 8 deals with TCP/IP internetworking

5 Internetworking with Routers
Routers Connect Multiple Networks (LANs and WANs) into an Internet Site B LAN 4 LAN 1 Router Z Router W LAN 3 Router X LAN 2 WAN Router Y Site A Site C

6 Figure 8-1: Major TCP/IP Standards
5 Application User Applications Supervisory Applications HTTP SMTP Many Others DNS Routing Protocols Many Others 4 Transport TCP UDP 3 Internet IP ICMP ARP 2 Data Link None: Use OSI Standards Internetworking is done at the internet and transport layers. There are only a few standards at these layers. 1 Physical None: Use OSI Standards Note: Shaded protocols are discussed in this chapter.

7 Figure 8-1: Major TCP/IP Standards, Continued
5 Application User Applications Supervisory Applications HTTP SMTP Many Others DNS Routing Protocols Many Others 4 Transport TCP UDP At the application layer, there are user applications and supervisory applications. We will look at two supervisory applications in this chapter. 3 Internet IP ICMP ARP 2 Data Link None: Use OSI Standards 1 Physical None: Use OSI Standards Note: Shaded protocols are discussed in this chapter.

8 Figure 8-2: Recap: IP, TCP, and UDP
Layer Protocol Connection- Oriented? Reliable? Lightweight or Heavyweight? 4 (Transport) TCP Yes Yes Heavyweight 4 (Transport) UDP No No Lightweight 3 (Internet) IP No No Lightweight

9 Figure 8-3: Hierarchical IP Address
Network Part (not always 16 bits) Subnet Part (not always 8 bits) Host Part (not always 8 bits) Total always is 32 bits The Internet UH Network ( ) 32-bit host IP addresses have three parts CBA Subnet (17) Host (13)

10 Figure 8-3: Hierarchical IP Address, Continued
Question. The IP address is How large is the network part?

11 Figure 8-4: Border Router, Internal Router, Networks, and Subnets
ISP Network 60.x.x.x Internal Router Corporate Network x.x Border Routers Connect Different Networks

12 Internal Routers Connect Different Subnets within the Firm
Figure 8-4: Border Router, Internal Router, Networks, and Subnets, Continued Subnet x Border Router Subnet x Internal Router Corporate Network x.x Subnet x Internal Routers Connect Different Subnets within the Firm

13 Figure 8-5: Part of an Internet
Router A Router B Router C Router B connects to 4 subnets via its 4 interfaces (ports) Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

14 Figure 8-5: Part of an Internet, Continued
Router A Router B Router C Router B Interface 1 Subnet x 802.11 Interface 4 11-… Router B’s Interface 1 is connected to a point-to-point subnet, x This subnet goes to Router A’s Interface 4, which has IP address and MAC address 11- … Each interface on a router has a different IP address and data link layer address. Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

15 Figure 8-5: Part of an Internet, Continued
Router A Router B Router C Router B Interface 4 Subnet x 802.11 Interface 1 21-… Router B’s interface 4 also connects To an point-to-point subnet, x. This reaches Interface 1 on Router C. This interface has IP address and MAC address 21- … Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

16 Figure 8-5: Part of an Internet, Continued
Router A Router B Router C Router B’s Interface 2 connects to Ethernet subnet x. This subnet has a single switch. Other devices on the subnet include a single router (D), a single Client PC (R), and a single server (X). Router B Interface 2 Ethernet Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

17 Figure 8-5: Part of an Internet, Continued
Router A Router B Router C Router B’s Interface 3 connects to Ethernet Subnet x This subnet has one server (Y) and two routers (E and F) Router B Interface 3 Ethernet Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

18 Figure 8-5: Part of an Internet, Continued
Router A Router B Router C A packet arrives in Interface 1 of Router B. The router will forward the packet out a different interface. Arriving Packet Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

19 Figure 8-5: Part of an Internet, Continued
Router A Router B Router C Interface 1 21-… Here the packet is sent out Interface 3, which connects to Subnet x It must be sent to Server Y, Router E, or Router F. Router B Interface 3 Ethernet Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

20 Figure 8-5: Part of an Internet, Continued
Router A Router B Router C Interface 1 21-… For a packet going to Server Y, The destination IP address is (Server Y, the destination host) The packet is put in a frame with Destination MAC address D1-… (Server Y) Router B Interface 3 Ethernet Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

21 Figure 8-5: Part of an Internet, Continued
Router A Router B Router C Interface 1 21-… For a packet going to Router E, which will take responsibility for the packet. The destination IP address is the IP address of the destination host. The packet is put in a frame with destination MAC address E1-… (Router E). Router B Interface 3 Ethernet Ethernet Switch 2 Subnet x Ethernet Switch 1 Subnet x Router D 1 C1-… Client PC R 47 A1-… Server X 19 B1-… Server Y 86 D1-… Router E 2 E1-… Router F 1 F1-…

22 Figure 8-6: Multiprotocol Routing
Unix Server Old NetWare Server Site B Edge Router Z Ethernet LAN 1 SNA IPX/ SPX Mainframe TCP/IP TCP/IP The Internet Most firms have a mix of internetworking architectures (TCP/IP, IPX/SPX, SNA, etc.). Consequently, most routers are multiprotocol routers that route the packets of multiple architectures. Multiprotocol Router X Ethernet LAN 3 Ethernet LAN 2 Internal Router Y WWW Server Site A

23 Figure 8-7: Ethernet Switching Versus IP Routing
Ethernet switching is fast and therefore inexpensive. For a destination MAC address, there is only one match in the table. This can be found quickly. The frame is sent out the port listed in that row. Switch 2 Ethernet Switching Port 5 on Switch 1 to Port 3 on Switch 2 Port 7 on Switch 2 to Port 4 on Switch 3 Switching Table Switch 1 Port Station 2 A1-44-D5-1F-AA-4C 7 B2-CD-13-5B-E4-65 5 C3-2D-55-3B-A9-4F 5 D C4-B6-9F 5 E5-BB D3-56 Switch 1 A1-44-D5-1F-AA-4C Switch 1, Port 2 B2-CD-13-5B-E4-65 Switch 1, Port 7

24 Figure 8-7: Ethernet Switching Versus IP Routing, Continued
Router B IP Routing Interface 1 Router A Network 60.x.x.x IP Routing Table Router A Interface Network 1 60.x.x.x x.x x.x.x 2 60.x.x.x x.x.x Interface 2 Router C Router topologies are meshes. This gives alternative routes. A destination IP address will Match multiple rows.

25 Figure 8-7: Ethernet Switching Versus IP Routing, Continued
Router B IP Routing Interface 1 Router A Network 60.x.x.x IP Routing Table Router A Interface Network 1 60.x.x.x x.x x.x.x 2 60.x.x.x x.x.x Interface 2 Router C All matching rows must be found. Then, the best match must be found. This is slow and therefore expensive.

26 Figure 8-7: Ethernet Switching Versus IP Routing, Continued
Ethernet (and most other) switching is inexpensive for a given traffic volume Router routing is expensive for a given traffic volume Network administrators say “Switch where you can; route where you must.”

27 Figure 8.8: Routing Table Row Destination Network or Subnet
Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 1 (/16) 47 2 G 2 (/24) 1 Local 3 (/24) 12 2 G Routers Base Routing Decisions on Their Routing Tables. Each Row Represents a Route to a Network or Subnet For Each Arriving Packet, The Packet’s Destination IP Address Is Matched Against the Destination Network or Subnet Field in Every Row

28 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 1 (/16) 47 2 G 2 (/24) 1 Local 3 (/24) 12 2 G Each Row Represents a Route to a Network or Subnet. All packets to that network or subnet are governed by that one row. So there is one rule for a range of IP addresses. This reduces the number of rows that must be considered.

29 Figure 8.9: Masking 1. Basic Process 2. Common Patterns
Information bit Mask bit Result 3. Example 1 IP Address Mask Result 2. Common Patterns Binary Decimal 4. Example 2 IP Address Mask Result

30 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 1 (/16) 47 2 G 2 (/24) 1 Local 3 (/24) 12 2 G Row 1 If Destination IP Address = Mask = Result = Destination Network or Subnet = No match!

31 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 1 (/16) 47 2 G 2 (/24) 1 Local 3 (/24) 12 2 G Row 2 If Destination IP Address = Mask = Result = Destination Network or Subnet = This row is a match!

32 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 1 (/16) 47 2 G 2 (/24) 1 Local 3 (/24) 12 2 G Row 3 If Destination IP Address = Mask = Result = Destination Network or Subnet = Is this row is a match?

33 Routing For Each Incoming IP Packet
Destination IP address is matched against every row in the routing table. If the routing table has 10,000 rows, 10,000 comparisons will be made for each packet. There can be multiple matching rows for a destination IP address, corresponding to multiple alternative routes. After all matches are found, the best match must be selected.

34 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 3 (/16) 12 2 G If only one row matches, it will be selected as the best row match. Destination IP address =

35 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 13 (/0) 5 3 H The default row always matches Mask applied to anything results in This always matches the Network/Subnet value The router specified for this row (H) is the default router

36 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 1 (/16) 47 2 G 7 (/24) 55 3 H If there are multiple matches, the row with the longest length of match is selected This is Row 7 for (24 bit match) Row 1’s length of match is only 16 bits Longer matches often are routes to a particular subnet within a network

37 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 5 (/24) 34 1 F 8 (/24) 20 3 H If there are multiple rows with the same lengths of match, the metric column compares alternative routes. If the metric is cost, the smallest metric wins (20) If the metric is speed, the largest metric wins (34)

38 The Situation The router first evaluated the IP destination address of the arriving packet against all rows and noted the matching rows. The router then selected the best-match row. Now, the router examines the interface and next-hop router fields in the best-match row to determine what to do with the packet.

39 Figure 8-11: Interface and Next-Hop Router
Forwarding Packet Possible Next-Hop Router Packet to Router B on Interface 5 Router A Router B IP Subnet on Interface (Port 5) Router C Packet must be sent to a particular host or router on the subnet out a particular interface (port). Possible Next-Hop Router Possible Destination Host

40 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 5 (/24) 34 1 F The Interface specifies the “out” port on the router. A subnet is attached to this interface. NHR column specifies a specific NHR on that subnet. For Row 5, send packet to NHR F on the subnet out Interface 1.

41 Figure 8.8: Routing Table, Continued
Row Destination Network or Subnet Mask (/Prefix) Metric (Cost) Interface Next- Hop Router 2 (/24) 1 Local If Next-Hop Router Field says Local, Then the destination host in on the subnet attached to the interface (1). Instead of sending the packet to a next-hop router on the subnet, the router will send the packet to its destination address.

42 Routing Recap The router looks at the destination IP address in the packet. First, the router finds all matching rows. Second, selects the best matching row. Third, sends packet back out the row’s specified interface, to the row’s specified next-hop router. Begins to process the next packet.

43 Quiz An IP address matches rows 112 and 456.
What row in the routing table will the router look at first when it searches for matching rows? (Trick question but one that illustrates a crucial point.)

44 Quiz 1,000 consecutive packets arrive, all going to the same destination IP address. The routing table has 100,000 rows. This destination IP address matches two rows in the routing table. In total, how many rows will the router have to examine?

45 Routing Recap, Continued
Switches only provide single possible paths, so there is only one matching entry in the switching table, and it is quickly found—the one corresponding to the single path. Routers have multiple alternative routes and so must evaluate every row (route) and then select the best match; this makes routers very expensive compared to switches for a comparable traffic volume.

46 Figure 8-12: Routing Protocols
Table Information Router Router Router Routers get the information for their routing tables by exchanging information via routing protocols. Router Routing Table Information Router

47 What is “Routing”? TCP/IP uses the term “routing” in two ways.
First, the forwarding of packets when they reach a router is called routing. Second, exchanges between routers in order to transfer routing table information is called routing.

48 Figure 8-13: Multiprotocol Label Switching (MPLS)
Label-Switching Router 1 Label- Switching Router 2 Legend Label- Switching Router 5 Label- Switching Router 3 Packet Label Multiprotocol Label Switching (MPLS) can simply forwarding and therefore reduce the cost of router operation. Label-Switching Router 4 Label-Switched Path

49 Figure 8-13: Multiprotocol Label Switching (MPLS), Continued
Label-Switching Router 1 Label- Switching Router 2 Legend Label- Switching Router 5 Label- Switching Router 3 Packet Label In multiprotocol label switching, a label-switched path is determined for a flow of similar packets. A label is added before each packet. Label-Switching Router 4 Label-Switched Path

50 Figure 8-13: Multiprotocol Label Switching (MPLS), Continued
Label-Switching Router 1 Label- Switching Router 2 Legend Label- Switching Router 5 Label- Switching Router 3 Label-switching routers along the way look only at a packet’s label, not at its destination IP address. The label-switching table tells the router what interface to use to send the packet out. Packet Label Label-Switching Router 4 Label-Switching Table Label Interface A 1 C 1 F 3 Label-Switched Path

51 Figure 8-13: Multiprotocol Label Switching (MPLS), Continued
Label-Switching Router 1 Label- Switching Router 2 Legend Label switching tables have only one row per label. As soon as the row is found, the packet can be sent back out. As in Ethernet switching, this is fast and therefore inexpensive. Label- Switching Router 5 Label- Switching Router 3 Packet Label Label-Switching Router 4 Label-Switching Table Label Interface A 1 C 1 F 3 Label-Switched Path

52 Figure 8-13: Multiprotocol Label Switching (MPLS), Continued
Label-Switching Router 1 Label- Switching Router 2 Legend Label- Switching Router 5 Label- Switching Router 3 Label switching is similar to the use of virtual circuits in PSDNs. Packet Label Label-Switching Router 4 Label-Switching Table Label Interface A 1 C 1 F 3 Label-Switched Path

53 Figure 8-13: Multiprotocol Label Switching (MPLS), Continued
MPLS makes transit through an internet much faster and therefore cheaper than traditional IP destination address-based routing In addition, more than one label can be set up for packets going to a particular network or subnet Different labels can give different priorities, etc. This allows different traffic to be given different service quality guarantees

54 Figure 8-14: Domain Name System (DNS) Hierarchy
Top-Level Domain Names (root) .edu In Chapter 1, we saw that DNS servers can provide a target host’s IP address if you only know its host name. However, DNS really is a general method for naming resources on the Internet. .net .org .com .au .ie .nl .uk Second-Level Domain Names hawaii.edu microsoft.com cnn.com Subnet Name cba.hawaii.edu voyager.cba.hawaii.edu Host Names ntl.cba.hawaii.edu

55 Figure 8-14: Domain Name System (DNS) Hierarchy, Continued
Top-Level Domain Names (root) .edu .net .org .com .au .ie .nl .uk Second-Level Domain Names hawaii.edu microsoft.com cnn.com DNS is organized as a hierarchy. The top level is the root. Top-level domains are organized by type (.com, .edu., etc.) by country (.uk, .ie, .ch, etc.) or by both (.com.us). Subnet Name cba.hawaii.edu voyager.cba.hawaii.edu Host Names ntl.cba.hawaii.edu

56 Figure 8-14: Domain Name System (DNS) Hierarchy, Continued
Top-Level Domain Names (root) Second level domains indicate a company (cnn.com) or a product (somemovie.com). Companies compete for good second-level domain names. (Panko.info, Microsoft.com) They can get these from domain name registrars. .edu .net .org .com .au .ie .nl .uk Second-Level Domain Names hawaii.edu microsoft.com cnn.com Subnet Name cba.hawaii.edu voyager.cba.hawaii.edu Host Names ntl.cba.hawaii.edu

57 Figure 8-14: Domain Name System (DNS) Hierarchy, Continued
Top-Level Domain Names (root) .edu At lower levels, more specific resources can be named. One example is the host name. voyager.cba.hawaii.edu ntl.cba.hawaii.edu .net .org .com .au .ie .nl .uk Second-Level Domain Names hawaii.edu microsoft.com cnn.com Subnet Name cba.hawaii.edu voyager.cba.hawaii.edu Host Names ntl.cba.hawaii.edu

58 Figure 8-1: Major TCP/IP Standards
5 Application User Applications Supervisory Applications HTTP SMTP Many Others DNS Routing Protocols Many Others 4 Transport TCP UDP 3 Internet IP ICMP ARP 2 Data Link None: Use OSI Standards 1 Physical None: Use OSI Standards Note: Shaded protocols are discussed in this chapter.

59 Figure 8-15: Internet Control Message Protocol (ICMP) for Supervisory Messages
Router Host Unreachable Error Message IP was created to deliver packets. ICMP was created to support supervisory messages at the internet layer. Echo Request (Ping) Echo Reply

60 Figure 8-15: Internet Control Message Protocol (ICMP) for Supervisory Messages, Continued
Router Host Unreachable Error Message Echo Request (Ping) ICMP Message IP Header ICMP messages are carried in the data fields of IP packets. There are no transport or application layer messages. Echo Response

61 Figure 8-15: Internet Control Message Protocol (ICMP) for Supervisory Messages, Continued
Router Host Unreachable Error Message ICMP error messages advise senders of delivery problems. This is not reliability; there is no automatic error correction. This is only error advisement. Echo Request (Ping) ICMP Message IP Header Echo Reply

62 Figure 8-15: Internet Control Message Protocol (ICMP) for Supervisory Messages, Continued
Echo messages can be used to “ping” IP addresses or host names. Pinged hosts reply with echo reply messages. This response indicates that the host is active. Router Host Unreachable Error Message ICMP Message IP Header Echo (Ping) Echo Reply

63

64 Figure 8-16: IPv4 and IPv6 Packets
Bit 0 IP Version 4 Packet Bit 31 Version (4 bits) Value is 4 (0100) Header Length (4 bits) Diff-Serv (8 bits) Total Length (16 bits) Length in octets Identification (16 bits) Unique value in each original IP packet Flags (3 bits) Fragment Offset (13 bits) Octets from start of original IP fragment’s data field Time to Live (8 bits) Protocol (8 bits) 1=ICMP, 6=TCP, 17=UDP Header Checksum (16 bits)

65 Figure 8-16: IPv4 and IPv6 Packets
Bit 0 IP Version 4 Packet Bit 31 Version (4 bits) Value is 4 (0100) Header Length (4 bits) Diff-Serv (8 bits) Total Length (16 bits) Length in octets Identification (16 bits) Unique value in each original IP packet Flags (3 bits) Fragment Offset (13 bits) Octets from start of original IP fragment’s data field The Version field tells the version of the Internet Protocol that the packet follows. The dominant version of IP today is Version 4. (IPv4) There were no earlier versions. Time to Live (8 bits) Protocol (8 bits) 1=ICMP, 6=TCP, 17=UDP Header Checksum (16 bits)

66 Figure 8-16: IPv4 and IPv6 Packets, Continued
Bit 0 IP Version 4 Packet TTL prevents misaddressed packets from circulating endlessly. The sender sets the TTL value. Each router along the way decrements (decreases) the TTL value by 1. If a router decrements TTL to 0, the router discards the packet. Bit 31 Version (4 bits) Value is 4 (0100) Header Length (4 bits) Diff-Serv (8 bits) Total Length (16 bits) Length in octets Identification (16 bits) Unique value in each original IP packet Flags (3 bits) Fragment Offset (13 bits) Octets from start of original IP fragment’s data field Time to Live (TTL) (8 bits) Protocol (8 bits) 1=ICMP, 6=TCP, 17=UDP Header Checksum (16 bits)

67 Figure 8-16: IPv4 and IPv6 Packets, Continued
Bit 0 IP Version 4 Packet Bit 31 Version (4 bits) Value is 4 (0100) Header Length (4 bits) Diff-Serv (8 bits) Total Length (16 bits) Length in octets The Protocol field tells the receiver what is in the packet’s data field. 1 = an ICMP message 6 = a TCP segment 17 = a UDP datagram There are other values for other purposes. Identification (16 bits) Unique value in each original IP packet Flags (3 bits) Fragment Offset (13 bits) Octets from start of original IP fragment’s data field Time to Live (8 bits) Protocol (8 bits) 1=ICMP, 6=TCP, 17=UDP Header Checksum (16 bits)

68 Figure 8-16: IPv4 and IPv6 Packets, Continued
IP Version 4 Packet Bit 31 Version (4 bits) Value is 4 (0100) Header Length (4 bits) Diff-Serv (8 bits) Total Length (16 bits) Length in octets Packets may be fragmented (broken into multiple packets) by routers along the way. Identification (16 bits) Unique value in each original IP packet Flags (3 bits) Fragment Offset (13 bits) Octets from start of original IP fragment’s data field Time to Live (8 bits) Protocol (8 bits) 1=ICMP, 6=TCP, 17=UDP Header Checksum (16 bits) The receiving host reassembles the fragmented packet using information in the Identification, Flags, and Fragment offset fields. However, fragmentation is rare and typically indicates a hacker attack.

69 Figure 8-16: IPv4 and IPv6 Packets, Continued
Bit 0 IP Version 4 Packet Bit 31 Source IP Address (32 bits) Destination IP Address (32 bits) Options (if any) Padding The source and destination IP address fields are 32 bits long, of course. Data Field

70 Figure 8-16: IPv4 and IPv6 Packets, Continued
Bit 0 IP Version 4 Packet Bit 31 Source IP Address (32 bits) Destination IP Address (32 bits) Options (if any) Padding Data Field The sender may add Options fields. if an option does not end at a 32-bit boundary, padding is added. Options are rare and usually indicate attacks.

71 Figure 8-16: IPv4 and IPv6 Packets, Continued
The data field contains a TCP segment, UDP datagram, ICMP message, or other content. Bit 0 IP Version 4 Packet Bit 31 Source IP Address (32 bits) Destination IP Address (32 bits) Options (if any) Padding Data Field

72 Figure 8-16: IPv4 and IPv6 Packets, Continued
Bit 0 IP Version 6 Packet Bit 31 Version Value is 6 (0110) Diff-Serv (8 bits) Flow Label (20 bits) Marks a packet as part of a specific flow The IETF has defined a new version of IP. This is Internet Protocol Version 6 (IPv6). The Version field value is 6 (0110). Payload Length (16 bits) Next Header (8 bits) Hop Limit (8 bits) Source IP Address (128 bits) Destination IP Address (128 bits) Next Header or Payload (Data Field)

73 Figure 8-16: IPv4 and IPv6 Packets, Continued
Bit 0 IP Version 6 Packet Bit 31 Version Value is 6 (0110) Diff-Serv (8 bits) Flow Label (20 bits) Marks a packet as part of a specific flow IPv6 has 128-bit source and destination IP addresses. This allows many more hosts. This is important because some areas of the world are running out of IP addresses. Payload Length (16 bits) Next Header (8 bits) Hop Limit (8 bits) Source IP Address (128 bits) Destination IP Address (128 bits) Next Header or Payload (Data Field)

74 Figure 8-16: IPv4 and IPv6 Packets, Continued
Bit 0 IP Version 6 Packet Bit 31 Version Value is 6 (0110) Diff-Serv (8 bits) Flow Label (20 bits) Marks a packet as part of a specific flow IPv6 adoption has been slow. IPv4 addresses are not very scarce yet, and implementing a new protocol is difficult because all routers must be changed. However, cellphones, a growing number of devices other than PCs connected to the Internet, and growth in Asia should spur demand for IPv6 adoption in the future. Payload Length (16 bits) Next Header (8 bits) Hop Limit (8 bits) Source IP Address (128 bits) Destination IP Address (128 bits) Next Header or Payload (Data Field)

75 Figure 8-17: TCP Segment and UDP Datagram
Bit 0 TCP Segment Bit 31 Source Port Number (16 bits) Destination Port Number (16 bits) Sequence Number (32 bits) Acknowledgement Number (32 bits) Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits)

76 Figure 8-17: TCP Segment and UDP Datagram
Bit 0 TCP Segment Bit 31 One-bit flag fields are used to characterize a TCP segment. If a bit is “set”, this means that its value is 1. The flag fields include SYN, ACK, FIN, and RST. In order: RST,ACK,PSH,URG,SYN, FIN 010010? Source Port Number (16 bits) Destination Port Number (16 bits) Sequence Number (32 bits) Acknowledgement Number (32 bits) Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits)

77 Figure 8-17: TCP Segment and UDP Datagram, Continued
Bit 0 TCP Segment Bit 31 Source Port Number (16 bits) Destination Port Number (16 bits) Sequence Number (32 bits) Acknowledgement Number (32 bits) The sequence number field allows TCP segments to be put in order if IP delivers them out of order Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits)

78 Figure 8-17: TCP Segment and UDP Datagram, Continued
Bit 0 TCP Segment Bit 31 The Acknowledgement Number field tells the other side which segment is being acknowledged. Source Port Number (16 bits) Destination Port Number (16 bits) Sequence Number (32 bits) Acknowledgement Number (32 bits) Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits) In TCP segments that are acknowledgements, the ACK bit is set.

79 Figure 8-17: TCP Segment and UDP Datagram, Continued
Bit 0 TCP Segment Bit 31 Source Port Number (16 bits) Destination Port Number (16 bits) In connection-opening requests, the SYN flag bit is set. Sequence Number (32 bits) Acknowledgement Number (32 bits) Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits)

80 Figure 8-17: TCP Segment and UDP Datagram, Continued
Bit 0 TCP Segment Bit 31 Source Port Number (16 bits) Destination Port Number (16 bits) In notifications of closings, the FIN bit is set. Sequence Number (32 bits) Acknowledgement Number (32 bits) Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits)

81 Figure 8-18: Normal Four-Way Closes and Abrupt Resets in TCP
FIN ACK FIN ACK A normal TCP close is a 4-way close.

82 Figure 8-18: Normal Four-Way Closes and Abrupt Resets in TCP, Continued
RST In an abrupt close, one side sends a RST segment in which the RST bit is set. The connection is closed by this one segment. There is no acknowledgements of the RST.

83 Figure 8-17: TCP Segment and UDP Datagram, Continued
Bit 0 TCP Segment Bit 31 Source Port Number (16 bits) Destination Port Number (16 bits) As Module A discusses, the Window Size field can be used in flow control by telling the other side how many more octets it can transmit before getting another acknowledgement. Sequence Number (32 bits) Acknowledgement Number (32 bits) Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits)

84 Figure 8-17: TCP Segment and UDP Datagram, Continued
Bit 0 TCP Segment Bit 31 The receiving transport process uses the TCP Checksum field to check the segment for errors. If the receiver finds errors, it discards the segment. If the segment is correct, the receiver sends an ACK. Source Port Number (16 bits) Destination Port Number (16 bits) Sequence Number (32 bits) Acknowledgement Number (32 bits) Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits)

85 Figure 8-17: TCP Segment and UDP Datagram, Continued
In contrast to IP packets, TCP segments often use options. TCP Segment Options (if any) Padding Data Field The data field contains an application message, or, in the case of a supervisory segment, is missing.

86 Figure 8-17: TCP Segment and UDP Datagram, Continued
Bit 0 TCP Segment Bit 31 Source Port Number (16 bits) Destination Port Number (16 bits) Sequence Number (32 bits) Acknowledgement Number (32 bits) Port number fields indicate the sending and receiving application processes. Similar to the Protocol field in IP packets. Header Length (4 bits) Reserved (6 bits) Flag Fields (6 bits) Window Size (16 bits) TCP Checksum (16 bits) Urgent Pointer (16 bits)

87 Figure 8-19: Use of TCP (and UDP) Port Numbers
Servers use well-known port numbers for their major applications. Port 80 = HTTP Ports 20, 21 = FTP Port 21 for supervisory information Port 20 for file transfers Port 23 = Telnet Port 25 = SMTP ( )

88 Figure 8-19: Use of TCP (and UDP) Port Numbers, Continued
Clients Use Ephemeral Port Numbers. By IETF rules, Ports to Windows follows the rules. Unix programs usually do not. The client chooses a random ephemeral port number for each new connection.

89 Figure 8-19: Use of TCP (and UDP) Port Numbers, Continued
Registered Port Numbers Ports 1024 through For non-major applications. Unix does not follow the rules for port number ranges. Unix uses some registered port numbers as ephemeral port numbers.

90 Figure 8-19: Use of TCP (and UDP) Port Numbers, Continued
Socket A socket is an IP address, a colon, and a port number. Example: :80 For servers, specifies a specific application on a specific server. For clients, specifies a specific connection on a specific client.

91 Using netstat -n

92 Figure 8-19: Use of TCP (and UDP) Port Numbers, Continued
Ephemeral Source Port Number (50047) Client From: :50047 To: :80 Well-Known Destination Port Number (80) Webserver Port 80 A connection has both a source and destination socket. Socket is based on the packet IP addresses and the TCP or UDP port number fields SMTP Server Port 25

93 Figure 8-19: Use of TCP (and UDP) Port Numbers, Continued
Client From: :50047 To: :80 From: :80 To: :50047 Webserver Port 80 In two-way communication, the sockets are reversed for transmissions in the opposite direction. SMTP Server Port 25

94 Figure 8-19: Use of TCP (and UDP) Port Numbers, Continued
Client From: :50047 To: :80 If a client connects to two servers, it will select different ephemeral port numbers (50047 and 60003) for the two connections Webserver Port 80 From: :60003 To: :25 SMTP Server Port 25

95 Figure 8-17: TCP Segment and UDP Datagram, Continued
Bit 0 UDP Datagram Bit 31 Source Port Number (16 bits) Destination Port Number (16 bits) UDP Length (16 bits) UDP Checksum (16 bits) Data Field UDP also uses source and destination port numbers. The UDP header is very simple because it does not have to handle connections, error correction, flow control, and other supervisory matters.

96 Figure 8-20: Layer 3 Switches and Routers in Site Internets
Border Router To Other Sites Layer 3 Switch L3 L3 Layer 3 switches are routers. However, they are faster than traditional software-based routers because they do processing in hardware. Switches are faster than routers, so marketers invented “Layer 3 switch. Layer 3 Switch Ethernet Workgroup Switch Ethernet Workgroup Switch

97 Figure 8-20: Layer 3 Switches and Routers in Site Internets, Continued
To Other Sites Border Router Layer 3 Switch L3 L3 Layer 3 switches are routers. However, hardware limitations mean that they are limited routers. They are not full multiprotocol routers. They only support TCP/IP and, sometimes, IPX/SPX. This limits their usefulness. Layer 3 Switch Ethernet Workgroup Switch Ethernet Workgroup Switch

98 Figure 8-20: Layer 3 Switches and Routers in Site Internets, Continued
Border Router To Other Sites Layer 3 Switch L3 L3 Layer 3 switches are routers. However, hardware limitations mean that they are limited routers. They usually cannot connect to WANs because they usually only implement Ethernet at the data link layer. A router is normally used at the border. Layer 3 Switch Ethernet Workgroup Switch Ethernet Workgroup Switch

99 Figure 8-20: Layer 3 Switches and Routers in Site Internets, Continued
Like traditional routers, L3 switches require considerable management labor. Therefore, they usually do not replace workgroups switches at the bottom of the hierarchy. To Other Sites Router Layer 3 Switch L3 L3 Layer 3 Switch Ethernet Workgroup Switch Ethernet Workgroup Switch User

100 Topics Covered IP Hierarchical IP addresses
Network, subnet, and host parts Parts vary in length, but the total is always 32 bits

101 Topics Covered IP Router Operation
Compare destination IP address of packet to each row to find all matching rows Find the best-match row based on length of match and metric values Send the packet out the indicated interface to the indicated destination host or next-hop router Multiprotocol routers are not limited to routing IP packets

102 Topics Covered IP Routing Protocols
Allow routers to share route information so they can update their routing tables Multiprotocol Label Switching (MPLS) Bases routing decisions on packet labels instead of IP addresses Reduces work compared to normal routing and therefore costs less

103 Topics Covered Domain Name System (DNS) ICMP
Not just to look up a destination host’s IP address if you only know its host name A general system for naming things on the Internet Firms want second-level domain names (cnn.com) ICMP For supervisory messages at the internet layer Error advisement messages of various types Pinging to see if a host or router is online

104 Topics Covered IPv4 Fields IPv6 Version Time to live (TTL) Protocol
Options (rare and suspicious) Data field IPv6 128-bit address fields to allow many more hosts on the Internet

105 Topics Covered TCP One-bit Flag fields (if value is 1, said to be set)
Sequence numbers Acknowledgement numbers and ACK bit FIN versus RST closes Window size field for flow control (Module A) Port numbers Well-known, registered for applications Ephemeral for client connections Socket syntax = IP address : port number

106 Topics Covered UDP Layer 3 Switches
Also has source and destination port numbers Otherwise simple because does not do supervisory chores Layer 3 Switches Routers, but fast and inexpensive like switches. But labor cost to manage any router is high Limited in protocol handling, interfaces Very attractive where they can be used


Download ppt "COS 338 Day 15."

Similar presentations


Ads by Google