The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is...

32
1 Chapter 6 The Protocol TCP/IP 1 Introduction to Protocols A protocol is a set of rules that governs the communications between computers on a network. These rules include guidelines that regulate the following characteristics of a network: o access method, o allowed physical topologies, o types of cabling, o speed of data transfer. 2

Transcript of The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is...

Page 1: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

1

Chapter 6

The Protocol TCP/IP

1

Introduction to Protocols

A protocol is a set of rules that governs the communications between computers on a network.

These rules include guidelines that regulate the following characteristics of a network:

o access method,

o allowed physical topologies,

o types of cabling,

o speed of data transfer.

2

Page 2: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

2

Introduction to Protocols (Cont.)

Protocols define the format, timing, sequence, and error checking used on the network.

To provide shared access to information and resources, LANs must deliver information that is correct, in proper time sequential order, and understood by the recipient.

To accomplish these functions, electrical circuits, error detection systems, error correction systems, information coding, data flow control, data formatting systems, and other hardware/software subsystems must all perform in a cooperative fashion following a set of rules or "protocols".

3

Introduction to Protocols (Cont.)

Protocols can be implemented either in hardware or software or a mixture of both.

Typically, the lower layers are implemented in hardware, with the higher layers being implemented in software.

Protocols could be grouped into suites (or families, or stacks) by their technical functions, or origin of the protocol introduction, or both.

4

Page 3: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

3

Protocol Types

5

Connection-Oriented Protocols

In connection-oriented services, a path is established between the two communicating parties before any data is exchanged. This ensures that there is a route between the two parties in addition to ensuring that both parties are alive and responding. In addition, most connection-oriented protocols guarantee delivery, which increases overhead as additional computations are performed to verify correctness.

6

Page 4: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

4

Connectionless Protocols

A connectionless protocol makes no guarantees that the recipient is listening. A connectionless service is similar to the postal service: the sender addresses a letter to a particular person and puts it in the mail. The sender doesn't know if the recipient is expecting to receive a letter or if severe storms are preventing the post office from delivering the message.

7

Routable Protocols

If a protocol is routable, a successful communication path can be set up (either a virtual connection-oriented circuit or a data path for datagram communication) between two workstations, no matter what network hardware lies between them. For example, machine A is on a separate network from machine B. A router linking the two networks separates the two machines. A routable protocol realizes that machine B is not on the same network as machine A; therefore, the protocol directs the data to the router, which decides how to best forward it so that it reaches machine B.

8

Page 5: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

5

Non-Routable Protocols

A non-routable protocol is not able to make such provisions; the router drops any packets of non-routable protocols that it receives. The router does not forward a packet from a non-routable protocol even if the packet's intended destination is on the connected subnet. NetBEUI is the only A Three-Layer Model.

9

Introduction to TCP/IP

TCP/IP is the protocol suite used for communications between hosts in most local networks and on the Internet.

TCP/IP stands for the Transmission Control Protocol/Internet Protocol. TCP/IP is used for enabling network communications in LANs, campus networks, and wide area networks as long as the hosts support the TCP/IP protocol.

TCP/IP is widely supported and is included in operating systems such as Windows 9x, NT, Me, 2K and XP, Unix,

and Linux.

10

Page 6: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

6

TCP/IP Protocol

The main power of the Internet lies in two protocols:

o the Transmission Control Protocol (TCP),

o the Internet Protocol (IP).

Because of this, the Internet suite of protocols is referred to as the TCP/IP protocol suite.

TCP is very close to the definition of transport layer of the OSI-RM. It provides a connection-oriented delivery of data between two distributed applications in the Internet. TCP provides this reliable service on the top of an unreliable IP.

IP is responsible for the routing and switching of datagrams through the Internet.

11

A comparison between TCP and IP

12

Page 7: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

7

Chapter 6-2

the TCP/IP Layers

13

TCP/IP compared to the OSI Model

14

Page 8: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

8

15

The Application Layer

16

The top level of the TCP/IP stack is the application layer. This layer is used to process requests from hosts and to ensure a connection is made to an appropriate port. A port is basically an address used to direct data to the proper destination application.

Page 9: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

9

Transport Layer The transport layer protocols in TCP/IP are very important

in establishing a network connection, managing the delivery of data between a source and destination host, and terminating the data connection.

There are two transport protocols within the TCP/IP transport layer. These are TCP and UDP. The first protocol examined is TCP.

TCP, the Transport Control Protocol is a connection oriented protocol. A connection oriented protocol establishes the network connection, manages the data transfer, and terminates the connection.

The TCP protocol establishes a set of rules or guidelines for establishing the connection. TCP verifies the delivery of the data packets through the network and includes support for error checking and recovering lost data. TCP then specifies a procedure for terminating the network connection.

17

UDP

UDP, the User Datagram Protocol is a connectionless protocol. This means that UDP packets are transported over the network without a connection being established and without any acknowledgement that the data packets arrived at the destination. UDP is useful in applications such as videoconferencing and audio feeds where acknowledgements that the data packet arrived are not necessary.

18

Page 10: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

10

The Internet Layer

The TCP/IP Internet layer defines the protocols used for addressing and routing the data packets. Protocols that are part of the TCP/IP Internet layer include IP, ARP, ICMP, and IGMP.

19

IP (Internet Protocol)

IP, the Internet Protocol, defines the addressing used for identifying the source and destination addresses of data packets being delivered over an IP network.

The IP address is a logical address that consists of a network and a host address portion. The network portion is used to direct the data to the proper network.

The host address identifies the address locally assigned to the host. The network portion of the address is similar to the area code for a telephone number. The host address in similar to the local exchange number. The network and host portions of the IP address are then used to route the data packets to the destination.

20

Page 11: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

11

The Network Interface Layer

The network interface layer of the TCP/IP model defines how the host connects to the network.

Recall that the host can be a computer or a networking device such as a router.

The type of network to which the host connects is not dictated by the TCP/IP protocol.

The host could be a computer connected to an Ethernet or token-ring network or a router connected to a frame relay wide area network.

TCP/IP is not dependent on a specific networking technology; therefore, TCP/IP can be adapted to run on newer networking technologies such as asynchronous transfer mode (ATM).

21

ARP (Address Resolution Protocol)

ARP, the Address Resolution Protocol, is used to resolve an IP address to a hardware address for final delivery of data packets to the destination.

ARP issues a query in a network called an ARP request, asking which network interface has this IP address. The host assigned the IP address replies with an ARP reply that contains the hardware address for the destination host.

22

Page 12: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

12

ICMP Protocol

ICMP, the Internet Control Message Protocol is used to control the flow of data in the network , reporting errors, and for performing diagnostics. A networking device, such as a router, sends an ICMP source-quench packet to a host that requests a slowdown in the data transfer.

A very important troubleshooting tool within the

ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity with another host in the network. The destination host could be in a LAN, a campus LAN, or on the Internet.

23

IGMP Protocol

IGMP is the Internet Group Message Protocol. IGMP is used when one host needs to send data to many destination hosts. This is called multicasting.

The addresses used to send a multicast data packet are called multicast addresses. These are reserved addresses that are not assigned to hosts in a network.

An example of an application that uses IGMP packets is when a router uses multicasting to share routing tables. This is explained in Chapter 7 when routing protocols are examined.

24

Page 13: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

13

IGMP Protocol

Another application to use IGMP packets is when a hosts wants to stream data to multiple hosts.

Streaming means the data are sent without waiting for any acknowledgement that the data packets were delivered. In fact, in the IGMP protocol, the source doesn’t care if the destination receives a packet.

Streaming is an important application in the transfer of audio and video files over the Internet. Another feature of IGMP is the data is handed off to the application layer as it arrives. This enables to begin processing the data for playback.

25

Chapter 6-4

IPv4 Addressing

26

Page 14: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

14

The IPv4 classes and address range

Table 6-7 IPv4 Address Classes and

Address Range

Class IP Address Range

A 0.0.0.0 to 127.255.255.255

B 128.0.0.0 to 191.255.255.255

C 192.0.0.0 to 223.255.255.255

D 224.0.0.0 to 239.255.255.255

E 240.0.0.0 to 254.255.255.255

27

The structure of the 32-bit IPv4 address

28

Page 15: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

15

Figure 6-12 The structure of the 32-bit IP address.

10 10 20 1

29

The octets making up the network and host portions of the IPv4 address for classes A, B, and C.

30

Page 16: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

16

Table 6-9 The breakdown of the network and host bits by class.

Class Network Bits Host Bits

A 8 24

B 16 16

C 24 8

31

32

Page 17: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

17

Address ranges in class A,B, and C have been set aside for private use. These addresses, called private addresses, are not used for Internet data traffic but are intended to be used specifically on internal networks called Intranets.

33

Functionally, private addresses work the same as public addresses except private addresses are not routed on the Internet. These are called non-routable IP address and are block by the Internet Service Providers.

34

Page 18: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

18

ARIN

IP addresses are assigned by ARIN, the American Registry for Internet Numbers. www.arin.net

ARIN assigns IP address space to Internet Service Provides (ISP) and end users. ARIN only assigns IP address space to ISPs and end users if they qualify.

This requires that the ISP or end user be large enough to merit a block of addresses. In the case where blocks of addresses are allocated by ARIN to the ISPs, the ISPs issue addresses to their customers.

For example, a Telco could be the ISP that has a large block of IP addresses and issues an IP address to a user. A local ISP could also be assigned a block of IP addresses from ARIN, but the local ISP must have a large number of users.

35

ARIN

ARIN also assigns end users IP addresses. Once again, the end user must qualify to receive a block of addresses from ARIN. This usually means that the end user must be large.

For example, many universities and large businesses can receive a block of IP addresses from ARIN. However, most end users will get their IP addresses from an ISP (e.g. Telco) or have IP addresses assigned dynamically when they connect to the ISP.

36

Page 19: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

19

Chapter 6-5

Subnet Masks

37

Subnetting

Subnetting is a technique used to break down (or partition) networks into subnets. The subnets are created through the use of subnet masks.

The subnet mask identifies what bits in the IP address are to be used to represent the network/subnet portion of an IP address.

38

Page 20: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

20

39

The subnets are created by borrowing bits from the host portion of the IP address as shown.

The network portion of the IP address and the new subnet bits are used to define the new subnet. Routers use this information to properly forward data packets to the proper subnet.

40

Page 21: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

21

The Class C network, shown is partitioned into four subnets. It takes 2 bits to provide four possible subnets therefore 2-bits are borrowed from the host bits.

This means the process of creating the four subnets reduces the number of bits available for host IP addresses.

41

42

Page 22: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

22

The equations for calculating the number of subnets created and the number of hosts/subnet.

43

44

Page 23: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

23

192.168.12.0

Network

Subnet A Subnet B Subnet C Subnet D

subnet mask = ?

Partitioning a network into subnets.

45

Network Host

24 + 2 = 26 bits 6 bits

The next step is to determine the subnet mask required for creating the four subnets. Recall that creating the four subnets required borrowing 2 host bits. The two MSB (most significant bit) positions, borrowed from the host and network portion of the IP address must be included in the subnet mask selection. The purpose of the subnet mask is to specify the bit positions used to identify the network and subnet bits.

46

Page 24: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

24

47

Applying equations 6-1 and 6-2 to calculate the number of subnets and hosts/subnet.

48

Page 25: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

25

Creating the subnet mask to select the 192.168.12.0 subnet.

192 168 12 - - - -

49

50

Page 26: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

26

subnet

Network Host

Network Subnet bits Host bits

Borrowing bits from the host to create subnets.

Borrowed bits

Network

Network + Subnet

51

52

Page 27: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

27

Table 6-12

53

54

Page 28: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

28

55

Example 6-8

Given a network address of 10.0.0.0, divide the network

into 8 subnets. Specify the subnet mask, the broadcast

addresses, and the number of usable hosts/subnet.

56

Page 29: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

29

The 224 comes from setting the subnet mask to select the 3 MSB position in the host portion of the address as shown in Fig. 6-17

57

8 + 3

5 + 8 + 8

Network + Subnet

bits host bits

58

Page 30: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

30

59

Example 6-9

Determine the subnet mask needed for the router link

shown. Only two host addresses are required for this

router-to-router link.

60

Page 31: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

31

Example 6-9

Determine the subnet mask needed for the router link

shown. Only two host addresses are required for this

router-to-router link.

Answer: 255.255.255.252

61

Subnet Mask

Computer’s use the subnet mask to control data flow within network’s.

The subnet mask is used to determine if the destination IP address is intended for a host in the same LAN or if the data packet should be sent to the gateway IP address of the LAN.

The gateway IP address is typically the physical network interface on a layer 3 switch or a router.

62

Page 32: The Protocol TCP/IP€¦ · The Protocol TCP/IP 1 Introduction to Protocols ... ICMP protocol is PING, the Packet InterNet Groper. The ping command is used to verify connectivity

32

Subnet Mask

For example, assume that the IP address of the computer in the LAN is 172.16.35.3.

A subnet mask of 255.255.255.0 is being used. This means that that all data packets with an IP address between 172.16.35.0 and 172.16.35.255 stay in the LAN.

A data packet with a destination IP address of 172.16.34.15 is sent to the LAN gateway. The 255.255.255.0 subnet mask indicates that all bits in the first three octets must match each other to stay in this

LAN. 63

Destination Network ?

This can be verified by “ANDing” the subnet mask with the destination address as shown.

172. 16. 35.3

255.255.255.0

172. 16. 35.0 in the same subnet as the LAN

172. 16. 34.15

255.255.255 .0

172. 16. 34. 0 not in the same subnet as the LAN

64