46
TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute of Information Technology

TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Embed Size (px)

Citation preview

Page 1: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

TCP/IP Protocol Suite

Networks and Protocols

Prepared by: TGK First Prepared on: Last Modified on:

Quality checked by: Copyright 2009 Asia Pacific Institute of Information Technology

Page 2: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 2 of 27

Topic & Structure of the lesson

Introduction to TCP/IPAddress Resolution Protocol (ARP)Internet Control Message Protocol (ICMP)Internet Protocol (IP)User Datagram Protocol (UDP)Transmission Control Protocol (TCP)

Page 3: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 3 of 27

Learning Outcomes

At the end of this module, YOU should be able to:

• Discuss the operations and implementations of different protocols under the TCP/IP suite.

• Discuss the benefits and considerations for choosing the appropriate TCP/IP protocol for use in a network.

Page 4: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 4 of 27

Key Terms you must be able to use

If you have mastered this topic, you should be able to use the following terms correctly in your assignments and exams:

• Regenerate signals

Page 5: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 5 of 27

Main Teaching Points

• Repeater

Page 6: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 6 of 27

Introduction to TCP/IP

• Developed for the Advanced Projects Research Agency

(ARPA)

• Designed to network a wide variety of computing

platforms, allowing expensive resources to be shared

across the USA

• Designed to be fault tolerant in case of nuclear or other

war

• Originally heavily based on UNIX systems

Page 7: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 7 of 27

• The purpose of TCP/IP

• Provides a common communication standard for

network devices (e.g. mainframes, PCs, remote

devices, telephones, etc.)

• Provides a framework for interconnection and

interoperation regardless of platform or physical

network medium

• Where is TCP/IP used?

• Basic applications:

• Telnet (23) : Remote terminal session

Introduction to TCP/IP

Page 8: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 8 of 27

• FTP (21/20) : File Transfer

• SMTP/POP (25/110) : Electronic mail

• NFS (uses RPC) : Network File System

• More advanced applications:

• HTTP (WWW port 80)

• A transport for just about everything

• TCP/IP overview

• The term TCP/IP is used generically to refer to

anything and everything related to the specific

network (IP) and transport (TCP) layer protocols:

Introduction to TCP/IP

Page 9: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 9 of 27

• TCP

• UDP

• IP

• ARP

• TELNET

• FTP

• Layered protocols

• Early communication software was one big

program which did everything

Introduction to TCP/IP

Page 10: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 10 of 27

• Early communication software was one big

program which did everything

• Difficult to modify and add new functionality

• The program was broken down into parts or

layers, each layer with very specific functionality

• ISO 7 – layer model

Introduction to TCP/IP

Page 11: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

• TCP/IP stack

• TCP/IP in relation to the OSI 7 – layer model

• Data flow through stack

• Data from the application flows down through the

layers

• Each layer ads its own header information

• Each layer multiplexes data from one or more

higher places

Introduction to TCP/IP

Page 12: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 12 of 27

• Data from the network flows upward through the

layer

• Each layer strips off the corresponding layer’s

header information

• Each layer de-multiplexes information to one or

more higher layers

• An Ethernet card recognises an Ethernet frame

which has its own address in the destination

address field

• The link layer passes the data to the correct

network layer protocol based

Introduction to TCP/IP

Page 13: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 13 of 27

• The link layer passes the data to the correct

network layer protocol based on the contents of

the TYPE field

• The IP layer passes data up to the next layer

based on the contents of the protocol field in the

IP header

• The next layer passes data up to the specific

application based on the contents of the Port field

in the TCP/UDP header

Introduction to TCP/IP

Page 14: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Address Resolution Protocol (ARP)

• Addressing issues

• TCP/IP is designed for many different types of

physical network:

• Ethernet

• Token Ring

• Leased lines

• Each has its own format for physical addressing

• To run successfully on all existing and future physical

networks, IP addressing must be independent of the

physical layer

Page 15: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 15 of 27

• You have no control over the address assigned to

your network interface

• The manufacturer encodes the address onto the

interface (i.e. physical address)

• If the card fails and is replaced, the machine’s physical

address changes

• Addressing problems:

• Machines send data to each other using the physical

address

• We want to send data to another computer’s IP

address

Address Resolution Protocol (ARP)

Page 16: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 16 of 27

Address Resolution Protocol (ARP)

• The ARP protocol is used to do this

• Example of ARP process:

• machine A wants to send data to machine B whose

IP address is aaa.bb.ccc.ddd

• sends a broadcast packet, with 0806 in the type

field

• Who has IP address aaa.bbb.ccc.ddd?

• machine B recognises its own IP address and

responds, ‘Hello, that’s me! Here is my hardware

address’

Page 17: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 17 of 27

• machine A now has B’s physical address

• The IP frame can now be coded into a properly

addressed Ethernet frame

Address Resolution Protocol (ARP)

Page 18: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 18 of 27

• The answer is held in a cache so that the next time

A has data for B, it can simply look in the cache for

its physical address

• Frequently used addresses stay in the cache

• Others time-out so as not to waste memory space

Address Resolution Protocol (ARP)

Page 19: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 19 of 27

Internet Control Message Protocol (ICMP)

• IP provides best-effort delivery

• Delivery problems can be ignored; datagrams can be

“thrown away”

• ICMP provides error-reporting mechanism

• Error detection

• Internet layer can detect a variety of errors:

• Checksum (header)

• Time-To-Live (TTL) expired

• No route to destination network

• Can’t deliver to destination host (e.g no ARP reply)

Page 20: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

• Internet layer discards datagrams with problems

• Error reporting

• Some errors can be reported

• Router sends message back to source in datagram

• Message contains information about problem

• Encapsulation in IP datagram

• Types of messages

• ICMP defines error and informational messages

Internet Control Message Protocol (ICMP)

Page 21: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 21 of 27

Internet Control Message Protocol (ICMP)

• Error messages:

• Source quench

• Time exceeded

• Destination unreachable

• Redirect

• Fragmentation required

• Informational messages:

• Echo request/reply

• Address mask request/reply

• Router discovery

Page 22: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 22 of 27

• Message Transport

• ICMP encapsulated in IP

• ICMP messages sent in response to incoming

datagrams with problems

• ICMP message not sent for ICMP message

Internet Control Message Protocol (ICMP)

Page 23: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 23 of 27

• ICMP and Reachability

• An Internet host A, is reachable from another host B,

if datagrams can be delivered from A to B

• ping program tests reachability – sends datagram

from B to A that A echoes back to B

• Use ICMP echo request and echo reply messages

• Internet layer includes code to reply to incoming ICMP

echo request messages

Internet Control Message Protocol (ICMP)

Page 24: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 24 of 27

Internet Control Message Protocol (ICMP)

• Ping sample output (Windows)

Page 25: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 25 of 27

Internet Protocol (IP)

• IP module is central to Internet technology

• Routes IP packets between intermediate systems

• Fragmentation and re-assembly

• Unreliable datagram service

• IP address: 32 bit value

• Usually written as four octets in dotted decimal notation

• Consists of two parts: network number and host number

• Three classes of IP address: class A, B, and C

• Twenty + RFCs specifying IP

Page 26: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 26 of 27

Internet Protocol (IP)

Page 27: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 27 of 27

Internet Protocol (IP)

• Ver – format of IP header (e.g. 4 or 6)

• IHL – IP header length in 32 bit words

• TOS – Type of Service

• Total length – bytes in the datagram

• Identification – IP packet ID number

• Flags – may/don’t/last/more fragment(s)

• Fragment Offset – for fragment reassembly

• TTL – packet time to live (hops)

• Protocol – protocol to give data to

Page 28: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 28 of 27

• Header Checksum – checksum on header only

• Source Address – IP address of packet originator

• Destination Address – IP address of destination

• IP Address Classes

Internet Protocol (IP)

Page 29: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 29 of 27

Internet Protocol (IP)

Page 30: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 30 of 27

Internet Protocol (IP)

Page 31: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 31 of 27

Internet Protocol (IP)

• Subnet Mask

• You have no control over the network address

• Assigned by e.g. RIPE, RIR, etc.

• Subnet mask allows you to assign part of the host

field of the address to be network number

• Allows your network to be divided into interior

networks; externally only one network address is

sufficient to access your site

• Keeps size of external routing tables to a minimum

Page 32: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 32 of 27

Internet Protocol (IP)

• The effect of the Netmask

Page 33: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 33 of 27

Internet Protocol (IP)

• As the number of subnets increases, the number of

hosts possible on each subnet decreases

• The node number of a host on a given subnet is

added to the subnet address to give the complete IP

number for the node

• E.g. With a subnet mask of 255.255.255.128 and a

network number of 193.77.140.128, Host 1 on this

network would have the IP number – 193.77.140.129

Page 34: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 34 of 27

• Best-effort Delivery

• IP is designed to work over all types of network

hardware, which may malfunction

• So IP datagrams may get lost, may be duplicated, may

be delayed, may be delivered out of order, or may be

delivered in a corrupt state

• We need higher layers of protocol software to deal

with these errors

Internet Protocol (IP)

Page 35: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 35 of 27

User Datagram Protocol (UDP)

• Connectionless unreliable datagram delivery service

• Adds only port number for multiplexing and delivery to

application and checksum

• If checksum fails on receipt, packet is simply discarded

• If application can’t accept data, packet is discarded]

• Low overhead: only 8 bytes of header added

• Used for broadcasts

• NFS

• DNS

Page 36: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 36 of 27

• UDP datagram:

• Source port – sending process (reply to this port)

• Destination port – receiving process

• Length – length of UDP header + data

• Checksum – pseudo header + UDP header + data

User Datagram Protocol (UDP)

Page 37: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 37 of 27

Transmission Control Protocol (TCP)

• The transport layer

• has no concept of routing

• does not know about any intermediate nodes

• Reliable delivery

• TCP works on top of IP

• TCP is connection-oriented. It corrects lost,

corrupted, out-of-order and delayed packets

• Guaranteed delivery service

• Positive acknowledgement with timeout and re-

transmission

Page 38: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 38 of 27

• Sliding window protocol

• Full-duplex connection

• Used for:

• Telnet

• FTP

• SMTP

• There are Twenty RFCs describing TCP

• How TCP ensures reliability

• Every message has a sequence number. The receiver

can tell if a message is missing or out of order

Transmission Control Protocol (TCP)

Page 39: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 39 of 27

• Corrupted messages are detected by means of

checksums

• TCP acknowledges all correctly received messages

(sends ACK to the sender)

• TCP header:

Transmission Control Protocol (TCP)

Page 40: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 40 of 27

Transmission Control Protocol (TCP)

• Initial sequence numbers are chosen randomly and

sent to the other side when the connection is set up

• Source port – the sending process

• Destination port – the receiving process

• Sequence number – sequence number of first byte of

data in the segment

• Acknowledgement number

• Valid if ACK bit is set

• Gives sequence number of next data expected to

be received

Page 41: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 41 of 27

• Data offset (or HLEN) – number of 32-bit words in

TCP header

• Flags (or Code Bits)

• Window – number of bytes sender will accept

• Checksum – pseudo header + TCP header + data

• Urgent – points to byte in segment that follows

urgent data

Page 42: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 42 of 27

Quick Review Question

Page 43: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 43 of 27

Follow Up Assignment

Page 44: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 44 of 27

Summary of Main Teaching Points

Page 45: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 45 of 27

Q & A

Question and Answer Session

Page 46: TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute

Networks and Protocols

TCP/IP Protocol Suite

Slide 46 of 27

Topic and Structure of next session

Next Session