+ All Categories
Home > Documents > 05-TCP-IP

05-TCP-IP

Date post: 19-Jul-2016
Category:
Upload: asim-saeed
View: 215 times
Download: 1 times
Share this document with a friend
Description:
IP Networkings
27
1 06/02/2006 1 Dr. L. Christofi 1 Local Local Local Local & Metropolitan Metropolitan Metropolitan Metropolitan Area Networks Area Networks Area Networks Area Networks ACOE322 Lecture 5 TCP/IP Protocol suite and IP addressing Dr. L. Christofi 2 0. INTRODUCTION INTRODUCTION INTRODUCTION INTRODUCTION We shall cover in this topic: 1. The relation of TCP/IP with internet and OSI model 2. Internet layer 3. Transport layer and UDP 4. Application layer Dr. L. Christofi 3 1. History and Future of TCP/IP The U.S. Department of Defense (DoD) created the TCP/IP reference model because it wanted a network that could survive any conditions. Some of the layers in the TCP/IP model have the same name as layers in the OSI model.
Transcript
Page 1: 05-TCP-IP

1

06/02/2006 1

Dr. L. Christofi 1

Local Local Local Local &&&& Metropolitan Metropolitan Metropolitan Metropolitan

Area NetworksArea NetworksArea NetworksArea Networks

ACOE322

Lecture 5

TCP/IP Protocol suite

and

IP addressing

Dr. L. Christofi 2

0. INTRODUCTIONINTRODUCTIONINTRODUCTIONINTRODUCTION

We shall cover in this topic:

1. The relation of TCP/IP with internet and OSI model

2. Internet layer

3. Transport layer and UDP

4. Application layer

Dr. L. Christofi 3

1. History and Future of TCP/IP

• The U.S. Department of Defense (DoD) created the TCP/IP reference model because it wanted a network that could survive any conditions.

• Some of the layers in the TCP/IP model have the same name as layers in the OSI model.

Page 2: 05-TCP-IP

2

06/02/2006 2

Dr. L. Christofi 4

Application Layer

• Handles high-level protocols, issues of representation, encoding, and dialog control.

• The TCP/IP protocol suite combines all application related issues into one layer and ensures this data is properly packaged before passing it on to the next layer.

Dr. L. Christofi 5

Transport Layer

Five basic services:

— Segmenting upper-layer application data

— Establishing end-to-end operations

— Sending segments from one end host to another end host

— Ensuring data reliability

— Providing flow control

Dr. L. Christofi 6

Layer 4 Protocols

Page 3: 05-TCP-IP

3

06/02/2006 3

Dr. L. Christofi 7

Internet Layer

• The purpose of the Internet layer is to send packets from a network node and have them arrive at the destination node independent of the path taken.

• Internet layer protocols:

—Internet Protocol (IP)

—Internet Control Message Protocol (ICMP)

—Address Resolution Protocol (ARP)

—Reverse Address Resolution Protocol (RARP)

Dr. L. Christofi 8

Network Access Layer

• The network access layer is concerned with all of the issues that an IP packet requires to actually make a physical link to the network media.

• It includes the LAN and WAN technology details, and all the details contained in the OSI physical and data link layers.

Dr. L. Christofi 9

Comparing the OSI Model and

TCP/IP Model

Page 4: 05-TCP-IP

4

06/02/2006 4

Dr. L. Christofi 10

Similarities of the OSI and TCP/IP

models

• Both have layers.

• Both have application layers, though they include very different services.

• Both have comparable transport and network layers.

• Packet-switched, not circuit-switched, technology is assumed.

• Networking professionals need to know both models.

Dr. L. Christofi 11

Differences of the OSI and TCP/IP

models

• TCP/IP combines the presentation and session layer into its application layer.

• TCP/IP combines the OSI data link and physical layers into one layer.

• TCP/IP appears simpler because it has fewer layers.

• TCP/IP transport layer using UDP does not always guarantee reliable delivery of packets as the transport layer in the OSI model does.

Dr. L. Christofi 12

Internet Architecture

• Two computers, anywhere in the world, following certain hardware, software, protocol specifications, can communicate, reliably even when not directly connected.

• LANs are no longer scalable beyond a certain number of stations or geographic separation.

Page 5: 05-TCP-IP

5

06/02/2006 5

Dr. L. Christofi 13

2. TCP/IP Internet layer

Internet Addresses

Dr. L. Christofi 14

IP Address as a

32-Bit Binary Number

Dr. L. Christofi 15

Binary and Decimal Conversion

Page 6: 05-TCP-IP

6

06/02/2006 6

Dr. L. Christofi 16

IP Address Classes

Dr. L. Christofi 17

IP Address Classes

Dr. L. Christofi 18

IP Addresses as Decimal

Numbers

Page 7: 05-TCP-IP

7

06/02/2006 7

Dr. L. Christofi 19

Hosts for Classes of

IP Addresses

Class A (24 bits for hosts) 224 - 2* = 16,777,214 maximum hosts

Class B (16 bits for hosts) 216 - 2* = 65,534 maximum hosts

Class C (8 bits for hosts) 28 - 2* = 254 maximum hosts

* Subtracting the network and broadcast reserved address

Dr. L. Christofi 20

IP Addresses as Decimal

Numbers

Class D: MulticastClass E: Research

Dr. L. Christofi 21

An IP address such as 176.10.255.255 that has all binary 1s

in the host bit positions is reserved for the broadcast address.

An IP address such as 176.10.0.0 that has all binary 0s in the host bit positions is reserved for the network address.

Network IDs and Broadcast

Addresses

Page 8: 05-TCP-IP

8

06/02/2006 8

Dr. L. Christofi 22

Private Addresses

These addresses are NEVER used on the Internet and should never appear on the Internet. They are used only for private networks.

Dr. L. Christofi 23

Reserved Address Space

• Network ID

• Broadcast address

• Hosts for classes of IP addresses

Dr. L. Christofi 24

Basics of Subnetting

• Classical IP addressing

• Subnetworks

• Subnet mask

• Boolean operations: AND, OR, and NOT

• Performing the AND function

Page 9: 05-TCP-IP

9

06/02/2006 9

Dr. L. Christofi 25

Subnetworks

• To create a subnet address, a network administrator borrows bits from the original host portion and designates them as the subnet field.

Dr. L. Christofi 26

Subnetworks

Dr. L. Christofi 27

Subnet Mask

• Determines which part of an IP address is the network field and which part is the host field

• Follow these steps to determine the subnet mask:—1. Express the subnetwork IP address in binary form.

— 2. Replace the network and subnet portion of the address with all 1s.

— 3. Replace the host portion of the address with all 0s.

— 4. Convert the binary expression back to dotted-decimal notation.

Page 10: 05-TCP-IP

10

06/02/2006 10

Dr. L. Christofi 28

Subnet mask in decimal = 255.255.240.0

Subnet Mask

Dr. L. Christofi 29

• Recall

— AND is like multiplication

— OR is like addition

— NOT changes 1 to 0, and 0 to 1.

Boolean Operations:

AND, OR, and NOT

Dr. L. Christofi 30

Performing the AND Function

Page 11: 05-TCP-IP

11

06/02/2006 11

Dr. L. Christofi 31

Range of Bits Needed to Create

Subnets

Dr. L. Christofi 32

Subnet Addresses

Dr. L. Christofi 33

Decimal Equivalents of 8-Bit

Patterns

Page 12: 05-TCP-IP

12

06/02/2006 12

Dr. L. Christofi 34

Creating a Subnet

• Determining subnet mask size

• Computing subnet mask and IP address

• Computing hosts per subnetwork

• Boolean AND operation

• IP configuration on a network diagram

• Host and subnet schemes

• Private addresses

Dr. L. Christofi 35

Class B address with 8 bits borrowed for the subnet

130.5.2.144 (8 bits borrowed for subnetting) routes to subnet 130.5.2.0 rather than just to network 130.5.0.0.

Determining Subnet Mask Size

Dr. L. Christofi 36

The address 197.15.22.131 would be on the

subnet 197.15.22.128.

Host FieldSNNetwork Field

00011100000101100000111111000101

Class C address 197.15.22.131 with a subnet mask of 255.255.255.224 (3 bits borrowed)

Determining Subnet Mask Size

Page 13: 05-TCP-IP

13

06/02/2006 13

Dr. L. Christofi 37

Subnetting Example

with AND Operation

Dr. L. Christofi 38

The router connects subnetworks and networks.

IP Configuration on a Network

Diagram

Dr. L. Christofi 39

The number of lost IP addresses with a Class C network depends on the number of bits borrowed for subnetting.

Host Subnet Schemes

Page 14: 05-TCP-IP

14

06/02/2006 14

Dr. L. Christofi 40

Broadcast addresses exercise

Address Subnet Mask Class Subnet Broadcast

201.222.10.60 255.255.255.248

15.16.193.6 255.255.248.0

128.16.32.13 255.255.255.252

153.50.6.27 255.255.255.128

64.10.19.152 255.255.240.0

Fill-in the class, subnet and broadcast IP addresses in the following table

Dr. L. Christofi 41

Broadcast addresses exercise

answer

Address Subnet Mask Class Subnet Broadcast

201.222.10.60 255.255.255.248 C 201.222.10.56 201.222.10.63

15.16.193.6 255.255.248.0 A 15.16.192.0 15.16.199.255

128.16.32.13 255.255.255.252 B 128.16.32.12 128.16.32.15

153.50.6.27 255.255.255.128 B 153.50.6.0 153.50.6.127

64.10.19.152 255.255.240.0 A 64.10.16.0 64.10.31.255

Fill-in the class, subnet and broadcast IP addresses in the following table

Dr. L. Christofi 42

Exercise 1

• Given the IP address 192.168.100.86 find

—The default mask

—The subnet mask, assuming 5 bits of subnetting

—The subnet IP address

—The broadcast address

—The first and last valid host IP addresses

Page 15: 05-TCP-IP

15

06/02/2006 15

Dr. L. Christofi 43

Exercise 1 answer

• Given the IP address 192.168.100.86 find—The default mask:

It is a class C address, therefore Default mask is 255.255.255.0

—The subnet mask, assuming 5 bits of subnetting

5 bits for subnet, 3 remaining bit for host addresses, so subnet mask is 255.255.255.248

—The subnet IP address: 192.168.100.80

—The broadcast address: 192.168.100.87

—The first and last valid host IP addresses

1st valid host address: 192.168.100.81

Last valid host address: 192.168.100.86

Dr. L. Christofi 44

Exercise 2

• Given the IP address 172.16.164.32/19 find

—The default mask

—The subnet mask

—The subnet IP address

—The broadcast address

—The first and last valid host IP addresses

Dr. L. Christofi 45

Exercise 2 answer

• Given the IP address 172.16.164.32/19 find

—The default mask

It is a class B address, so Default mask is 255.255.0.0

—The subnet mask: 255.255.224.0

—The subnet IP address: 172.16.160.0

—The broadcast address: 172.16.191.255

—The first and last valid host IP addresses

1st valid host address: 172.16.160.1

Last valid host address: 172.16.191.254

Page 16: 05-TCP-IP

16

06/02/2006 16

Dr. L. Christofi 46

IPv4 versus IPv6

• IP version 6 (IPv6) has been defined and developed.

• IPv6 uses 128 bits rather than the 32 bits currently used in IPv4.

• IPv6 uses hexadecimal numbers to represent the 128 bits.

IPv4

Dr. L. Christofi 47

Obtaining an IP Address

• Static addressing—Each individual device must be configured with an IP address.

• Dynamic addressing—Reverse Address Resolution Protocol (RARP)

—Bootstrap Protocol (BOOTP)

—Dynamic Host Configuration Protocol (DHCP)

—DHCP initialization sequence

—Function of the Address Resolution Protocol

—ARP operation within a subnet

Dr. L. Christofi 48

A default gateway is the IPaddress of the interface on the router that connects to the network segment on which the source host is located.

Default Gateway

Page 17: 05-TCP-IP

17

06/02/2006 17

Dr. L. Christofi 49

3. TCP/IP Transport Layer

Five basic services:

• Segmenting upper-layer application data

• Establishing end-to-end operations

• Sending segments from one end host to another end host

• Ensuring data reliability

• Providing flow control

Dr. L. Christofi 50

Flow Control

• Avoids the problem of a host at one side of the connection overflowing the buffers in the host at the other side

• Ensures the integrity of the data

Dr. L. Christofi 51

Session Establishment

Page 18: 05-TCP-IP

18

06/02/2006 18

Dr. L. Christofi 52

Three-Way Handshake

Dr. L. Christofi 53

Windowing

• A method of controlling the amount of information transferred end to end

• Information can be measured in terms of the number of packets or the number of bytes

Dr. L. Christofi 54

Window Size

Larger window sizes increase communication efficiency.

Page 19: 05-TCP-IP

19

06/02/2006 19

Dr. L. Christofi 55

Acknowledgment

• Positive acknowledgment requires a recipient to communicate with the source, sending back an acknowledgment message when it receives data.

• Sender keeps a record of each data packet that it sends and expects an acknowledgment.

Dr. L. Christofi 56

Layer 4 Protocols

Dr. L. Christofi 57

TCP

• Connection oriented

• Reliable

• Divides outgoing messages into segments

• Reassembles messages at the destination station

• Resends anything not received

• Reassembles messages from incoming segments

Page 20: 05-TCP-IP

20

06/02/2006 20

Dr. L. Christofi 58

UDP

• Connectionless

• Unreliable

• Transmits messages (called user datagrams)

• Provides no software checking for message delivery (unreliable)

• Does not reassemble incoming messages

• Uses no acknowledgments

• Provides no flow control

Dr. L. Christofi 59

TCP/IP Protocol Graph

Dr. L. Christofi 60

TCP Segment Format

Page 21: 05-TCP-IP

21

06/02/2006 21

Dr. L. Christofi 61

UDP Segment Format

Dr. L. Christofi 62

Port Numbers

Dr. L. Christofi 63

4. TCP/IP Application Layer

Page 22: 05-TCP-IP

22

06/02/2006 22

Dr. L. Christofi 64

Responsibilities

• Identifying and establishing the availability of intended communication partners

• Synchronizing cooperating applications

• Establishing agreement on procedures for error recovery

• Controlling data integrity

Dr. L. Christofi 65

Application Layer Examples

• Domain Name System (DNS)

• File Transfer Protocol (FTP)

• Hypertext Transfer Protocol (HTTP) and World Wide Web (WWW)

• Simple Mail Transport Protocol (SNTP)

• Simple Network Management Protocol (SNMP)

• Telnet

Dr. L. Christofi 66

Domain Name System (DNS)• To identify an entity the Internet uses the IP address, which

uniquely identifies the connection of a host to the Internet• However, people prefer to use names instead of numeric

addresses• Therefore we need a system that can map a name to an address

or an address to a name• When the Internet was small, mapping was done using a host file• Today is impossible to have a single host file to relate every

address to a name and vice versa. The host file would be too large to store in every host

• One solution is to store the entire host file in a single computer and allow access to this centralized info to every PC that needs a mapping – but this would create a huge amount of traffic

• Another solution is to divide this huge amount of info into smaller parts and store each part on a different computer. In this method, the host that needs mapping can contact the closest computer holding the needed info.

• This method is used by the DNS system.

Page 23: 05-TCP-IP

23

06/02/2006 23

Dr. L. Christofi 67

Domain Name System

Dr. L. Christofi 68

FTP (1)• File transfer protocol (FTP) is a TCP/IP client-server application for

copying files from one host to another.

• FTP requires two connections for data transfer: a control connection and a data connection.

• FTP employs ASCII for communication between dissimilar systems.

• Prior to the actual transfer of files, the file type, data structure, and transmission mode are defined by the client through the control connection.

• Responses are sent from the server to the client during connection establishment.

Dr. L. Christofi 69

FTP (2)• There are three types of file transfer:

— A file is copied from the server to the client.

— A file is copied from the client to the server.

— A list of directories or file names is sent from the server to the client.

• Most operating systems provide a user-friendly interface between FTP and the user.

• Anonymous FTP provides a method of the general public to access files on remote sites.

Page 24: 05-TCP-IP

24

06/02/2006 24

Dr. L. Christofi 70

SMTP

• One of the most important network services is electronic mail (email)

• Electronic mail is used for sending a single message that includes text, voice, video or graphics to one or more recipients

• Simple Mail Transfer Protocol (SMTP) is the standard mechanism for electronic mail in the Internet

Dr. L. Christofi 71

SMTP

• E-mail servers communicate with each other using the Simple Mail Transport Protocol (SMTP) to send and receive mail.

Dr. L. Christofi 72

SMTP

Page 25: 05-TCP-IP

25

06/02/2006 25

Dr. L. Christofi 73

HTTP

• The Hypertext Transfer Protocol (HTTP) is used mainly to access data on the World Wide Web.

• Hypertext Markup Language (HTML) is a language used to create static Web pages.

• The protocol transfers data in the form of plain text, hypertext, audio, video and so on.

• It is called HTTP because it is used in an environment where there are rapid jumps from one document to another

• HTTP functions like a combination of FTP and SMTP- It is similar to FTP because it transfers files and uses the services of

TCP (via port 80). There is no separate control connection – only data are transferred between the client and the server

- HTTP is also similar to SMTP because the data transferred between the client and the server are similar to SMTP messages

Dr. L. Christofi 74

WWW (1)

• The HTTP is the main protocol used to access data on the World Wide Web (WWW).

• The World Wide Web is a repository of information spread all over the world and linked together.

• Hypertext and hypermedia are documents linked to one another through the con-cept of pointers.

• Browsers interpret and display a Web document.

• A browser consists of a controller, client programs, and interpreters.

• A Web document can be classified as static, dynamic, or active.

• A static document is one in which the contents are fixed and stored in a server. The client can make no changes in the serverdocument.

• Any browser can read formatting instructions (tags) embedded in an HTML document.

Dr. L. Christofi 75

WWW (2)• A dynamic Web document is created by a server only at a browser

request.

• The Common Gateway Interface (CGI) is a standard for creating and handling dynamic Web documents. A CGI program with its embedded CGI interface tags can be written in a language such asC, C++, shell script, or Perl.

• The server sends the output of the CGI program to the browser.

• The output of a CGI program can be text, graphics, binary data, status codes, instructions, or an address of a file.

• An active document is a copy of a program retrieved by the client and run at the client site.

• Java is a combination of a high-level programming language, a run-time environment, and a class library that allows a programmer to write an active document and a browser to run it.

• Java is used to created applets (small application programs).

• Java is an object-oriented typed language with a rich library of classes.

Page 26: 05-TCP-IP

26

06/02/2006 26

Dr. L. Christofi 76

SNMP

• The Simple Network Management Protocol (SNMP) is an application layer protocol that facilitates the exchange of management information between network devices.

• An SNMP managed network consists of the following:

— Network management system (NMS)

— Managed device

— Agents

Dr. L. Christofi 77

Telnet

• Telnet client software provides the ability to log in to a remote Internet host that is running a Telnet server application and then to execute commands from the command line.

Dr. L. Christofi 78

Design a private LAN, with the following topology, that would allow the exchange of data:

Your subnet is 192.168.200.64. You should use appropriate subnetmask and assign appropriate IP addresses to all network elements(routers & hosts) having in mind possible future expansion of your network for 5 additional hosts. You have been told not to waste unnecessary IP addresses.

Exercise 3

Page 27: 05-TCP-IP

27

06/02/2006 27

Dr. L. Christofi 79

Subnet is 192.168.200.64.

Present number of hosts is 5, Number of routers is 2 and for future expansion 5 additional hosts, makes a total of 12 addresses.

Hence use 255.255.255.240 Subnet Mask.

Broadcast IP address for this network is reserved to 192.168.200.79 therefore available IP addresses are from 192.168.200.65 to 192.168.200.78

Exercise 3 (answer)

Dr. L. Christofi 80

References

• W. Stalling, Local and Metropolitan Area Networks, 6th edition, Prentice Hall, 2000

• F. Halsall, Data Communications, Computer Networks and Open Systems, 4th edition, Addison Wesley, 1995

• B.A. Forouzan, Data Communications and Networking, 3rd edition, McGraw-Hill, 2004

• W. Stallings, Data and Computer Communications, 7th edition, Prentice Hall, 2004


Recommended