Você está na página 1de 106

TCP/IP

Objectives
After completing this module the participants will be able to:

Describe the protocols in the TCP/IP stack Describe IP addresses Explain address resolution

Describe transport layer protocols


Outline the different versions of IP Describe common TCP/IP applications

Why TCP/IP?
De facto standard for the Internet
ITU and ISO issues de jure standards

Most popular protocol for data transport Next-generation telecommunication networks are IPbased

History of TCP/IP

1969 ARPANET went into operation 1974 TCP/IP designed by Vinton G. Cerf and Robert E. Kahn 1979 IP version 4 documented

1979 The Internet Control and Configuration Board (ICCB) was formed
1979 BSD Unix with TCP/IP supplied to universities

History of TCP/IP (cont)


1980 ARPA started converting machines to TCP/IP 1983 (January 1) IPv4 addresses were started to be given out 1986 NSFNET developed to replace ARPANET 1991 NSF decided to move backbone to a private company 1993 final NSF solicitations 1999 IPv6 addresses released

Internet Architecture Board

Internet Research Task Force (IRTF) Internet Engineering Task Force (IETF) Internet Assigned Numbers Authority (IANA) In 1999, IANA responsibilities was transferred to ICANN (Internet Corporation for Assigned Names and Numbers)

Internet Assigned Numbers Authority (IANA)


Function carried out by ICANN (Internet Corporation for Assigned Names and Numbers)

ARIN: American Registry for Internet Numbers RIPE: Reseaux IP European APNIC: Asia Pacific Network Information Center LACNIC: Latin America Network Information Center AFRINIC: Africa

RFC Standards Track Processes


1. 2.

Draft paper
RFC Specification

New RFCs takes new numbers IESG recommends promotion to Proposed Standard

3. 4. 5.

Proposed Standard Draft Standard Standard

Composed of several RFCs

Internet Standards
STD RFC Number Name

2500

Internet Official Protocol Standards

1700

Assigned Numbers

1122 1123

Requirement for Internet hosts

Internet Standards (cont)


STD

RFC Number

Name

5 6 7 8

791 768 793 854 855

Internet Protocol User Datagram Protocol Transport Control Protocol Telnet

959

File Transfer Protocol

OSI 7-Layer Model


Application Presentation Reduces complexity Standardized interface Ensures interoperability Accelerates evolution Network Data Link Physical

Session Transport

Simplifies teaching and


learning

Layer 1:Physical Layer

Defines type of medium, transmission method, and transmission rates available for the network Cables

Coax STP or UTP Fiber

Most common:

UTP Category 5 (Ethernet)


Simple to construct Easy to install

Devices in a LAN - NIC

NIC Network Interface Card

Coaxial Cable

Shielded Twisted Pair

100 meters maximum

Unshielded Twisted Pair (UTP)

Common on LANs today Inexpensive 100 meters max

Fiber

Very expensive Up to 2km 100Mbps +

Layer 2: Data Link Layer

Framing

Encapsulation Frame Formats Error detection (CRC, FCS) Error correction (Hamming distance) ARQ Sliding window

Error Control

Flow Control

Layer 2 devices:
Bridge (software-based) Switch (ASIC-based)

Types of Switch Operation

Cut-through

Store and forward

Switch checks destination address and immediately begins forwarding frame

Complete frame is received and checked before forwarding

Frame

Frame Frame

Frame

Fragment free (modified cut-through)

Switch checks the first 64 bytes then immediately begins forwarding frame

Frame

Layer 2: Data Link Layer (cont)


Examples of Layer 2 protocols:

Frame Relay Efficient Cost-effective Reliable Used in WAN connections PPP (Point-to-Point Protocol) Dial-up connections ATM (Asynchronous Transfer Mode)

IEEE Layer 2 Model


Network
Data Link

Network
LLC (Logical Link Control) MAC (Media Access Control)

Physical

Physical

Layer 3: Network Layer

Logical addressing

Software-based identification of devices Example: IP address


10.130.42.27 (Dotted Decimal Notation) 00001010 10000010 00101010 00011011 (Binary) 0A 82 2A 1B (Hexadecimal)

Routing

Optimal path determination Routing table Data movement

Need a Router?

Routers Big and Small

Routing
10.120.2.0 172.16.1.0

A router must know:


Destination address Possible routes Best/Optimal route

Routing (cont)
10.120.2.0 E0 172.16.1.0

S0

Network Protocol Connected Learned

Destination Network 10.120.2.0 172.16.1.0

Exit Interface E0 S0

Routed Protocol: IP

Routers must know how to forward packets to remote networks

Layer 3: Network Layer

Routing protocols

Run exclusively on routers Used to build/create routing tables Types: Distance-vector


RIP IGRP (Cisco proprietary) OSPF IS-IS

Link-state

Hybrid

EIGRP (Cisco proprietary)

What are Routing Protocols?


10.120.2.0
E0

172.16.1.0

S0

Network Protocol Connected RIP IGRP

Destination Network 10.120.2.0 172.16.2.0 172.17.3.0

Exit Interface E0 S0 S1

172.17.3.0

Routed Protocol: IP Routing protocol: RIP, IGRP

Interior vs. Exterior Routing Protocols


IGPs: RIP, IGRP EGPs: BGP

AS 200
Autonomous System is a collection of networks under a common administrative domain.

Layer 4: Transport Layer

Provides end-to-end data integrity and Quality of Service (QoS) Handles reliable delivery of messages Information flow control between applications
Sliding window protocol Buffering with Source Quench message

Examples of Layer 4 Protocols

TCP (Transport Control Protocol) UDP (User Datagram Protocol)

The Transport Layer


Hello! How fast can I send data?

I am busy now. Send data slowly.

Transport Layer
Application Presentation Session Transport Network Data Link Physical Application (SMTP,FTP,Telnet, SNMP,DNS, DHCP, ) Host-to-Host (TCP and UDP) Internetwork (IP, ICMP, ARP, RARP, IGMP)
Network Interface
(LAN = Ethernet, FDDI, Token Ring) (WAN = Serial, Frame Relay, ATM)

Transport Control Protocol (TCP)


Identifies applications through Port Numbers Assigned by IANA 1-1023 (well-known ports) Provides connection-oriented byte stream service Two applications must establish a TCP connection prior to data exchange Done through Three-way handshake

Transport Control Protocol (TCP)


Provides end-to-end reliable data delivery

Implements flow control algorithms


Commonly used flow control is Sliding window

TCP (cont)
TCP exchanges segments with the other end in order to :

Establish connection
Advertise window size Transfer data

Send ACK for received data segments


Close the connection

User Datagram Protocol (UDP)


Connectionless
No session is established; unlike TCP Does not guarantee delivery

No sequence numbers
No ACK Reliability is the responsibility of the application

Also uses Port Numbers to communicate


Low overhead compared to TCP

Lower Layers
Application Presentation Session
Reliable or unreliable delivery Error correction before retransmit

EXAMPLES
TCP UDP

Transport

Network

Provide logical addressing which routers use for path determination Combines bits into bytes and bytes into frames Access to media using MAC address Error detection not correction Move bits between devices Specifies voltage, wire speed and pin-out cables

IP IPX
802.3 / 802.2 HDLC EIA/TIA-232 V.35

Data Link

Physical

Layer 5 : Session Layer

Coordinates interaction between end-to-end application processes Responsible for enforcing rules of dialog

Simplex Half-duplex Full-duplex

Examples:
RPC - Programming technique SQL - Database access NFS - Network File System

Layer 5 Functions

Service Reply

Other Layer 5 protocols: X Window System

AppleTalk Session Protocol (ASP)


DNA Session Control Protocol (SCP)

Layer 6 : Presentation Layer


Converts code and reformats data Presents a readable format for the application Concerned with syntax and semantics of data being transmitted Examples: JPEG, GIF, PICT, TIFF MIDI, WAV, WMA MPEG

Layer 6 Functions

Layer 6 Functions (cont)

Layer 7: Application Layer

Interfaces directly with application programs running on devices

It provides services such as file access and transfer, peer-to-peer communication among applications, and resource sharing
Defines user-oriented applications

Layer 7: Application Layer (cont)

Applications that are not network-aware have Layer 7 components written by software developers Layer 7 examples: Telnet DNS DHCP HTTP

Layer 7 Example

An FTP server provides files that can be downloaded from the server and a place for files to be uploaded from the client.

Upper Layers
EXAMPLES

Application

User Interface

Telnet HTTP ASCII EBCDIC JPEG Operating System/ Application Access Scheduling

How data is presented Presentation Special processing such as encryption

Session
Transport Layer Network Layer Data Link Physical

Keeping different applications data separate

Upper Layer Implementation

Top three layer of the OSI model are softwarebased


Software developers usually integrates Layer 7,6 and 5 components when coding applications Network-aware applications have built-in Layer 5,6 and 7 components

Encapsulation
Application
Presentation Upper Layer Data TCP Header Upper Layer Data Session

PDU
Segment

Transport

IP Header

Data

Network

Packet

LLC Header

Data

FCS

Data Link

Frame

MAC Header

Data

FCS

0101110101001000010

Physical

Bits

De-encapsulation
Application
Presentation

Session

Upper Layer Data

Transport
Upper Layer Data

Network
TCP+ Upper Layer Data

IP + TCP + Upper Layer Data

Data Link
LLC Header + IP + TCP + Upper Layer Data

Physical
0101110101001000010

Internet Protocol

OSI vs TCP/IP
Application Presentation Session Transport Network Data Link Physical Application (SMTP,FTP,Telnet, SNMP,DNS, DHCP, ) Host-to-Host (TCP and UDP) Internetwork (IP, ICMP, ARP, RARP, IGMP)
Network Interface
(LAN = Ethernet, FDDI, Token Ring) (WAN = Serial, Frame Relay, ATM)

Internet Protocol (IP)


Provides logical 32-bit addressing Routes data packets Connectionless protocol; no session is established Best effort delivery Reliability is the responsibility of higher level
protocols and applications

Fragments and reassembles data

IP Addressing

32 bits
Dotted Decimal Maximum

Network

Host

255

255

255

255

IP Address Format
32-bit address 4 8-bit fields called octets Usually represented in dotted decimal notation

Binary Dotted Decimal

11000001 10100000 00000001 00000101

193.160.1.5

Traditional IP Address Classes


Class A 0
Class B 10

Host ID
Host ID

Class C 110 Class D 1110 Class E 11110 Group ID

Host ID

Traditional IP Addresses
Networks Hosts per Network

1st Octet
1-127 128-191 192-223 224-239

Class A Class B Class C Class D

126 16,384 2,097,152

16,777,214 65,534 254

Reserved IP Address Space


10.0.0.0 - 10.255.255.254 1 Class A network 16 Class B networks 172.16.0.0 - 172.31.255.254

192.168.0.0- 192.168.255.254
169.254.0.0. - 169.254.255.254

256 Class C networks


Link-local address

Subnet Mask

Contiguous 1s

Mask A: 11111111 11110000 00000000 00000000 Mask B: 11111111 11111111 11111111 11000000 Wrong : 11111111 11111101 11110000 00000000

Blocks out a portion of the IP address to distinguish Network ID from Host ID Specifies whether the destination IP address is located on a local network or on a remote network

Source IP [Binary AND] Subnet Mask Destination IP [Binary AND] Subnet Mask

If result of both ANDs match, the destination is on the local network

Subnet Mask Example


Is 160.130.20.10 on the same subnet as 160.130.20.100 if the subnet mask is 255.255.255.224?
IP #1 Mask Result1 IP #2 Mask Result 2 160.30.20.100 255.255.255.224 10100000 11111111 00011110 11111111 00010100 11111111 01100100 11100000 160.130.20.10 255.255.255.224 10100000 11111111 00011110 11111111 00010100 11111111 00001010 11100000

Default Masks

Class A: 11111111 00000000 00000000 00000000

255.0.0.0 or /8

Class B: 11111111 11111111 00000000 00000000

255.255.0.0 or /16

Class C: 11111111 11111111 11111111 00000000

255.255.255.0 or /24

Addressing Guidelines
Network ID cannot be 127
127 is reserved for loopback Network ID and Host ID cannot be 255 (all bits set to 1)

255 is a broadcast address


Network ID and Host ID cannot be 0 (all bits set to 0) 0 means this network only Host ID must be unique in the network

LAN Topology

Subnets

Subnetting
Why do we need subnets?

Optimize network traffic Reduce wasted address space Separate networks based on geography or location Create smaller broadcast domains

Addressing without Subnets

172.16.0.1 172.16.0.2 172.16.0.3

172.16.255.253 172.16.255.254 ...

172.16.0.0

Addressing with Subnets

172.16.3.0

172.16.4.0

172.16.1.0

172.16.2.0

Subnet Addressing
172.16.2.200 172.16.2.2 172.16.2.160 172.16.3.1 E1 E0 172.16.2.1 172.16.3.5 172.16.3.100 172.16.3.150

172.16 . 2 . 160 Network Subnet Host

Broadcast Address

172.16.3.0

172.16.4.0

172.16.1.0 172.16.3.255 (Directed broadcast) 172.16.2.0

255.255.255.255 (Local network broadcast)


172.16.255.255 (All subnets broadcast)

X X

Subnetting Example
IP address : 192.170.16.0 (a) 4 subnets

(b) 2 sites: Site A = 30 hosts, Site B = 20 hosts


(c) 2 hosts per subnet

(1) IP address class = ___________


(2) Subnet Mask = ______________ or /_____ (3) Valid IP addresses = _______ to _________ (4) Broadcast address = __________________

Exercise
(a) 192.168.254.0
(b) 130.5.64.0 (c) 150.30.128.0/20

50 subnets
6 subnets 500 computers

IP address class : ______________


Number of Subnets? _______________ Hosts per subnet? Subnet mask? _______________ _______________

Valid IP addresses ______ to _______


Subnet Broadcast

______________

Variable Length Subnet Mask (VLSM)


Used when there is a need for unequal-sized subnets Routing protocol used MUST support VLSM Supports VLSM:

EIGRP IS-IS (Intermediate System-to-Intermediate System) OSPF (Open Shortest Path First) RIP version 2

Does not support VLSM:


RIP version 1 IGRP (Interior gateway Routing Protocol)

TCP/IP Applications

DNS (Domain Name Service)

Internet addresses are hard for humans to remember, but easy for protocol software to work with
Converts URL into IP address Example: yahoo.com -> 10.120.5.6 For GPRS:

Routing Area (RA) update Roaming PDP Context Activation (assigning which GGSN to use for the APN)

DNS (cont)

WINS (Windows Internet Name Service)

Used by Microsoft for Peer-to-Peer networking Converts NetBIOS into IP address Example: My_pc into 10.102.100.134 Can be used in tandem with DNS to resolve local names My_pc.smart.com.ph

ARP (Address Resolution Protocol)

RFC 826

A source must know a destinations hardware address (MAC address) before it can send an IP packet to it.
ARP is the mechanism that maps IP to MAC address

ARP (cont)

ARP uses local broadcast (Layer 2) to obtain a hardware address dynamically ARP stores mapping for future use

Cache is flushed every two minutes

Static entries can be entered manually into the ARP cache

ARP (cont)
I need the Ethernet address of 172.16.3.2 I heard that broadcast, that is me. Here is my Ethernet address.

172.16.3.13 Arp a

172.16.3.2

Ipconfig /all

IP: 172.16.3.2 = ??? IP: 172.16.3.2 = Ethernet: 0800.0020.1111

Map IP Local ARP

Ethernet

ICMP (Internet Control Message Protocol)

Reports errors and sends control messages on behalf of IP


ICMP messages are encapsulated within an IP packet PING (Packet Internet Groper) is one of the most frequently-used debugging tools that uses ICMP

ICMP - Ping
Network Layer

Echo Request Echo Reply

Traceroute

Uses ICMP and the TTL field in the IP header


Source sends packet with TTL set to 1 First router sends back time exceeded message

Traceroute (cont)

Source increments TTL counter by 1

Process continues until ultimate


destination send back port unreachable message

Source uses the responses to display


the route on the destination

Traceroute (3)

New York Manila Los Angeles

Cebu

DHCP (Dynamic Host Configuration Protocol)

Used for automatic/dynamic allocation of IP addresses In GPRS:


Used to assign mobile IP addresses

IP address unique for each APN or Access Point Name

DHCP (Dynamic Host Configuration Protocol)

IP address allocation:

Manual

Uses a pre-determined network address and network configuration


1-to-1 mapping between MAC and IP

Automatic

Similar to manual allocation Mapping is allocated during initialization Once IP address is assigned to client, it cannot be returned to the address pool without intervention

DHCP (Dynamic Host Configuration Protocol)

IP address allocation:

Dynamic:

IP address is assigned for a limited period of time


Lease Time

Determined by the administrator

Allows addresses no longer needed to be automatically re-used or returned to the pool Clients attempt to renew lease when 50% of lease time has expired

If unsuccessful, it retries after 87.5% of the lease time has expired

DHCP Operation
1.

DHCPDISCOVER (Request for Lease)

Host sends a broadcast


DHCP server offers configuration data Hosts selects offer then informs DHCP Server assigns data to host

2.

DHCPOFFER

3.

DHCPREQUEST

4.

DHCPACK

NAT (Network Address Translation)

Developed to address rapid depletion of available IP addresses for Internet


Classic NAT

Pool of public IP addresses mapped to private IP addresses


Access is denied whenever pool is exhausted

NAT (Network Address Translation)

NAT using port numbers

Very useful when IP address pool is limited compared to private IP address

Assigns specific ports to each private IP address

IP-in-IP Encapsulation

Defined in RFC 1853/2003


Wrapping an IP packet with an external IP header Used in GPRS :

Gn interface (between SGSN and GGSN) using GTP (GPRS Tunneling Protocol)
Ga interface (between SGSN/GGSN and Charging Gateway) using GTP

External IP header provides a delivery mechanism for the internal IP packet

GRE (Generic Routing Encapsulation)

RFC 1701

Generic X over Y encapsulation


Multiple-protocol support

IPX

XNS
VINES AppleTalk

IP

VRRP (Virtual Router Redundancy Protocol)

Similar to Ciscos Hot Standby Router Redundancy Protocol


Eliminates single point of failure Used in GPRS:

Access to internet (Gi interface) Inter-PLMN connection (Gp)

RTP Real Time Protocol

Used for applications that require real-time processing such as video, audio

Has mechanisms to support real-time processing: timestamp, etc Used by H.323 and SIP Used by VoIP (Voice over IP) for media transport

IPv6

IP Version 6 (IPv6)
Why IPv6?

Rapid IPv4 address depletion NAT is only an interim solution Security features

IP Version 6 (IPv6)
2128 = 340,282,366,920,938,463,463,374,607,431,768,211,456 possible addresses

OR
655,570,793,348,866,943,898,599 IPv6 addresses for every
square meter of Earths surface

IP Version 6 (IPv6)

New features in version 6 Improved option mechanism

Simplifies and speeds up router processing of IPv6 packets

Address auto-configuration

Dynamic assignment of IP address Link-local addresses

Increased addressing flexibility

Anycast address

IPv6 Addressing

128-bit number (32-hex)

69DC:8864:0000:0000:0000:0003:0045:8C0A

Leading 0s can be omitted

69DC:8864:0:0:0:3:45:8C0A

Groups of 0s can be replaced by pair of colon

69DC:8864::3:45:8C0A

IPv6 Addressing (cont)

Like IPv4, IPv6 assigns a unique address for each device There are three types of IPv6 address

Unicast Multicast Anycast

No broadcast address defined in IPv6

Broadcast replaced by Anycast

IPv6 Addressing (cont)

There are several forms of unicast address assignment on IPv6

Aggregatable global unicast address


Either assigned by IANA or RIR Used with IEEE MAC address

Link-local address Site-local address Special address


Loopback Unspecified

Compatibility Addresses

IPv4-compatible address

Used by IPv6/IPv4 nodes IPv6 is encapsulated with IPv4 header and sent through IPv4 infrastructure ::w.x.y.z where w.x.y.z is the IPv4 address

IPv4-mapped address

Used for internal representation only ::FFFF:w.x.y.z

Compatibility Addresses (cont)

IPv4-translated address

No longer recommended ::FFFF:0:w.x.y.z

6-to-4 address

2002::/16 prefix Added with the IPv4 WWXX:YYZZ address representation of w.x.y.z to form a 2002:WWXX:YYZZ::/48 prefix Used to represent a site when using the automatic tunneling mechanism (RFC 3056)

Transition to IPv6
Dual TCP/UDP layer
Application

TCP/UDP

IPv6

IPv4

Network Interface

Transition to IPv6 (cont)


Dual TCP/IP stack

Microsoft implementation

Application
TCP/UDP IPv6 TCP/UDP IPv4

Windows XP Windows 2000 Windows 2003

Network Interface

Thank you

Você também pode gostar