+ All Categories
Home > Documents > TCP/IP Basics

TCP/IP Basics

Date post: 13-Jan-2016
Category:
Upload: gizela
View: 16 times
Download: 0 times
Share this document with a friend
Description:
TCP/IP Basics. Alvin Kwan. What is TCP/IP?. It is a protocol suite governing how data can be communicated in a network environment, both local and globally. - PowerPoint PPT Presentation
30
TCP/IP TCP/IP Basics Alvin Kwan Alvin Kwan
Transcript
Page 1: TCP/IP Basics

TCP/IP

TCP/IP BasicsTCP/IP Basics

Alvin KwanAlvin Kwan

Page 2: TCP/IP Basics

TCP/IP

What is TCP/IP?What is TCP/IP?

It is a protocol suite governing how data can It is a protocol suite governing how data can be communicated in a network environment, be communicated in a network environment, both local and globally.both local and globally.

To remind you what a protocol is, please read To remind you what a protocol is, please read http://www.leapforum.org/published/internetworkMobility/split/node10.html to learn a particular protocol known as ARQ to learn a particular protocol known as ARQ (automatic repeat request) protocol(automatic repeat request) protocol

Page 3: TCP/IP Basics

TCP/IP

OSI vs. TCP/IPOSI vs. TCP/IP

Page 4: TCP/IP Basics

TCP/IP

History of TCP/IP (1/2)History of TCP/IP (1/2)

Stands for Stands for Transmission Control Transmission Control Protocol/Internet ProtocolProtocol/Internet Protocol (TCP/IP)(TCP/IP)

Developed by Defense Advanced Research Developed by Defense Advanced Research Projects Agency (DARPA) under the Projects Agency (DARPA) under the sponsorship of U.S. Department of Defense sponsorship of U.S. Department of Defense (DoD) in since late 1960s(DoD) in since late 1960s

1972 – 1972 – TelnetTelnet 1973 – 1973 – File Transfer ProtocolFile Transfer Protocol (FTP) (FTP) 1974 – 1974 – Transmission Control ProtocolTransmission Control Protocol (TCP) (TCP)

Page 5: TCP/IP Basics

TCP/IP

History of TCP/IP (2/2)History of TCP/IP (2/2)

1980 – 1980 – User Datagram ProtocolUser Datagram Protocol (TCP) (TCP) 1981 – 1981 – Internet ProtocolInternet Protocol (TCP) (TCP) 1982 – TCP/IP as a protocol suite1982 – TCP/IP as a protocol suite 1984 – 1984 – Domain Name SystemDomain Name System (DNS) (DNS) 1991 – Transfer of funding responsibility from 1991 – Transfer of funding responsibility from

DAPRA to DAPRA to National Science FoundationNational Science Foundation (NSF), which started to turn the military (NSF), which started to turn the military originated protocols into civic use, notably in originated protocols into civic use, notably in education sector education sector

Page 6: TCP/IP Basics

TCP/IP

Some TCP/IP featuresSome TCP/IP features

It is an open standard, which is also adopted It is an open standard, which is also adopted by the Internet.by the Internet.

It offers a routable protocol such that the path It offers a routable protocol such that the path of every piece of data that moves through the of every piece of data that moves through the network is traceable.network is traceable.

It adopts a single and simple addressing It adopts a single and simple addressing scheme which is easy to understandscheme which is easy to understand

IP is a IP is a connectionlessconnectionless protocol (with data protocol (with data transferred in individual packets); whereas transferred in individual packets); whereas TCP is connection-oriented.TCP is connection-oriented.

Page 7: TCP/IP Basics

TCP/IP

Connectionless vs. Connection-oriented Protocols (1/2)

Connectionless vs. Connection-oriented Protocols (1/2)

Connectionless protocolsConnectionless protocols• The data communication method occurs between The data communication method occurs between

hosts with no previous setuphosts with no previous setup• Send data across the network to its destination without Send data across the network to its destination without

guaranteeing receiptguaranteeing receipt• Higher layers handle packet sequencing and certain Higher layers handle packet sequencing and certain

data integrity control issuesdata integrity control issues• Fast; require little overheadFast; require little overhead• Most LAN protocols at the data link layer are Most LAN protocols at the data link layer are

connectionlessconnectionless• Data packets in a connectionless communication are Data packets in a connectionless communication are

referred to as referred to as datagramsdatagrams

More to follow …

Page 8: TCP/IP Basics

TCP/IP

Connectionless vs. Connection-oriented Protocols (2/2)

Connectionless vs. Connection-oriented Protocols (2/2)

Connection-oriented protocolsConnection-oriented protocols• Establish a formal connection between two Establish a formal connection between two

computers, guaranteeing the data will reach its computers, guaranteeing the data will reach its destinationdestination

• Higher layers can rely on low layers to handle Higher layers can rely on low layers to handle matters of packet sequencing, data integrity, and matters of packet sequencing, data integrity, and delivery timeoutsdelivery timeouts

• Slower but more reliable Slower but more reliable • ATM networks are connection oriented at the ATM networks are connection oriented at the

data link layerdata link layer

Page 9: TCP/IP Basics

TCP/IP

Network Interface Layer (1/3)Network Interface Layer (1/3)

Lowest layer in the TCP/IP stackLowest layer in the TCP/IP stack To define how a computer connects to a To define how a computer connects to a

networknetwork It does not regulate the type of network that It does not regulate the type of network that

the host is on and thus TCP/IP can be run on the host is on and thus TCP/IP can be run on an Ethernet, Token Ring or Fiber Distributed an Ethernet, Token Ring or Fiber Distributed Data Interface (FDDI) or any other network Data Interface (FDDI) or any other network topologytopology

Page 10: TCP/IP Basics

TCP/IP

Network Interface Layer (2/3)Network Interface Layer (2/3)

Physical (or MAC) address, which is burnt Physical (or MAC) address, which is burnt into every network interface card (NIC)into every network interface card (NIC)

MAC address is usually represented in 12 MAC address is usually represented in 12 hexadecimal digits (or 48 bits)hexadecimal digits (or 48 bits)• First six hexadecimal digits uniquely represent First six hexadecimal digits uniquely represent

the manufacturerthe manufacturer

• Last six hexadecimal digits is a unique serial Last six hexadecimal digits is a unique serial number that the card’s manufacturer has number that the card’s manufacturer has assigned to the NICassigned to the NIC

Page 11: TCP/IP Basics

TCP/IP

Network Interface Layer (3/3)Network Interface Layer (3/3)

For a TCP/IP packet to be delivered, it must For a TCP/IP packet to be delivered, it must contain the destination node’s MAC address so contain the destination node’s MAC address so that a host can check whether the packet is that a host can check whether the packet is directed to it.directed to it.

A A broadcast packetbroadcast packet is designed to be attended is designed to be attended by all hosts and it has a target MAC address of by all hosts and it has a target MAC address of FFFFFFFF, i.e., all bits set.FFFFFFFF, i.e., all bits set.

Page 12: TCP/IP Basics

TCP/IP

The Internet LayerThe Internet Layer

The internal layer contains protocols for The internal layer contains protocols for addressing and routing of packets.addressing and routing of packets.• Internet Protocol (IP)Internet Protocol (IP)

• Address Resolution Protocol (ARP)Address Resolution Protocol (ARP)

• Internet Control Message Protocol (ICMP)Internet Control Message Protocol (ICMP)

• Internet Group Message Protocol (IGMP)Internet Group Message Protocol (IGMP)

• Routing protocols (e.g., RIP)Routing protocols (e.g., RIP)

Page 13: TCP/IP Basics

TCP/IP

Internet Protocol (1/2)Internet Protocol (1/2)

To determine the source and destination IP To determine the source and destination IP addresses of every packetaddresses of every packet

Every host on a network is assigned a unique Every host on a network is assigned a unique IP address (logical address)IP address (logical address)

IP address is divided into two parts: network IP address is divided into two parts: network number and host address on that networknumber and host address on that network

Based on the subnet mask and IP address, it Based on the subnet mask and IP address, it can be decided whether the target is a can be decided whether the target is a “remote” host or a “local” host (and details will “remote” host or a “local” host (and details will be given later)be given later)

Page 14: TCP/IP Basics

TCP/IP

Internet Protocol (2/2)Internet Protocol (2/2)

For a remote host, IP needs to send the For a remote host, IP needs to send the packet through a gateway or a router (which packet through a gateway or a router (which is also identified by an IP address).is also identified by an IP address).

Connectionless and thus unreliable Connectionless and thus unreliable transmissiiontransmissiion

Page 15: TCP/IP Basics

TCP/IP

Address Resolution Protocol (ARP)

Address Resolution Protocol (ARP)

Protocol to resolve an IP address to a physical Protocol to resolve an IP address to a physical address.address.

The hardware address will be cached for a short The hardware address will be cached for a short time.time.

To resolve an IP address to a physical addressTo resolve an IP address to a physical address• Try the ARP cache (kept in RAM)Try the ARP cache (kept in RAM)• If not found in cache, initiate an ARP request If not found in cache, initiate an ARP request

broadcast and keep the result in cachebroadcast and keep the result in cache• Try the command “ARP –A” in a command Try the command “ARP –A” in a command

windowwindow

Page 16: TCP/IP Basics

TCP/IP

ARP CommandARP Command

Page 17: TCP/IP Basics

TCP/IP

Internet Control Message Protocol (ICMP)

Internet Control Message Protocol (ICMP)

For sending error messages, performing For sending error messages, performing diagnostics and controlling data flowdiagnostics and controlling data flow

Try “ping cite.hku.hk” to test the network Try “ping cite.hku.hk” to test the network connection to another hostconnection to another host

Page 18: TCP/IP Basics

TCP/IP

Internet Group Message Protocol (IGMP)

Internet Group Message Protocol (IGMP)

IGMP enables one host to send one stream of IGMP enables one host to send one stream of data to many hosts at the same time with the data to many hosts at the same time with the use of a multicast addressuse of a multicast address

Some routing protocols use IGMP to Some routing protocols use IGMP to exchange routing tablesexchange routing tables

Page 19: TCP/IP Basics

TCP/IP

Routing ProtocolsRouting Protocols

Routing Information Protocol (RIP)Routing Information Protocol (RIP)• Simple IP-based routing protocol that collects Simple IP-based routing protocol that collects

and exchange information about network route and exchange information about network route and statusand status

• Only suitable for small networksOnly suitable for small networks Open Shortest Path First (OSPF)Open Shortest Path First (OSPF)

• Typically used by routers to determine the best Typically used by routers to determine the best path through a networkpath through a network

Page 20: TCP/IP Basics

TCP/IP

Transport LayerTransport Layer

Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)• Primary IP transport protocolPrimary IP transport protocol

• Connection-oriented and thus guarantee a more Connection-oriented and thus guarantee a more reliable deliveryreliable delivery

• Use port numbers to identify communicating Use port numbers to identify communicating applicationsapplications

• Responsible for message fragmentation and Responsible for message fragmentation and reassembly (with the use of sequence number)reassembly (with the use of sequence number)

User Datagram Protocol (UDP)User Datagram Protocol (UDP)• A connectionless transport protocol which runs fasterA connectionless transport protocol which runs faster

continued

Page 21: TCP/IP Basics

TCP/IP

TCP/IP ApplicationsTCP/IP Applications

Domain Name System (DNS)Domain Name System (DNS)• For URL to IP-address translationFor URL to IP-address translation

File Transfer Protocol (FTP)File Transfer Protocol (FTP)• Application protocol for file transfer and directory/file Application protocol for file transfer and directory/file

manipulation servicesmanipulation services TelnetTelnet

• For remote terminal sign-onFor remote terminal sign-on Simple Mail Transport Protocol (SMTP)Simple Mail Transport Protocol (SMTP)

• Provide messaging services (i.e., sending e-mails)Provide messaging services (i.e., sending e-mails)

continued

Page 22: TCP/IP Basics

TCP/IP

IP AddressingIP Addressing

IP is responsible for addressing and routing in the IP is responsible for addressing and routing in the TCP/IP environmentTCP/IP environment

IP addressesIP addresses• Logical addresses, which are 32 bits (4 bytes) longLogical addresses, which are 32 bits (4 bytes) long

• A decimal number from 0 to 255, separated by periods, A decimal number from 0 to 255, separated by periods, represents each byte or octetrepresents each byte or octet

• Two sectionsTwo sections One defines the network a computer is onOne defines the network a computer is on One defines the host ID for a computerOne defines the host ID for a computer

• Example: 172.24.206.18Example: 172.24.206.18

Page 23: TCP/IP Basics

TCP/IP

IP AddressingIP Addressing

Originally, three classes of IP addressesOriginally, three classes of IP addresses• Class AClass A

Large corporationsLarge corporations ID numbers between 1 and 126 (in its first octet, or 8 bits)ID numbers between 1 and 126 (in its first octet, or 8 bits)

• Class BClass B Medium-sized networksMedium-sized networks Network IDs between 128 and 191 (in its first octet, or 8 bits)Network IDs between 128 and 191 (in its first octet, or 8 bits)

• Class CClass C Small networksSmall networks Range from 192 to 223 (in its first octet, or 8 bits)Range from 192 to 223 (in its first octet, or 8 bits)

IP address registries manage the total collection of valid IP address registries manage the total collection of valid IP addressesIP addresses

Page 24: TCP/IP Basics

TCP/IP

IP AddressingIP Addressing

IP addresses are rapidly becoming scarceIP addresses are rapidly becoming scarce TCP/IP’s technical governing body has TCP/IP’s technical governing body has

reserved a series of addresses for private reserved a series of addresses for private networksnetworks

IETF is working on a new implementation of IETF is working on a new implementation of TCP/IP (IPv6) that uses addresses that are 8 TCP/IP (IPv6) that uses addresses that are 8 bytes long but retain backward compatibility bytes long but retain backward compatibility with IPv4 4-byte addresses with IPv4 4-byte addresses

Page 25: TCP/IP Basics

TCP/IP

Classless Inter-domain Routing (CIDR) (1/2)

Classless Inter-domain Routing (CIDR) (1/2)

A more efficient way to assign IP addresses than A more efficient way to assign IP addresses than using IP address “classes”using IP address “classes”

The network and host addresses boundary is not The network and host addresses boundary is not always made on octet boundaries, but may be always made on octet boundaries, but may be made any specific number of bits from the made any specific number of bits from the beginning of the addressbeginning of the address

Steal bits from the network address for use in the Steal bits from the network address for use in the host address and this is also called host address and this is also called supernettingsupernetting

A slash following IP address is used to indicate A slash following IP address is used to indicate the number of bits of the network address, e.g., the number of bits of the network address, e.g., 192.203.187.32 /22192.203.187.32 /22

Page 26: TCP/IP Basics

TCP/IP

Classless Inter-domain Routing (CIDR ) (2/2)

Classless Inter-domain Routing (CIDR ) (2/2)

AdvantagesAdvantages• Subnet ID may now be all 0’s or 1’sSubnet ID may now be all 0’s or 1’s• Avoid of wasting a number of IP addresses Avoid of wasting a number of IP addresses

when subnetting a Class C addresswhen subnetting a Class C address DisadvantagesDisadvantages

• Router support is neededRouter support is needed• All possible bit patterns used for supernetting All possible bit patterns used for supernetting

a network are to be reserved to be used by a network are to be reserved to be used by that network onlythat network only

Page 27: TCP/IP Basics

TCP/IP

Subnet MasksSubnet Masks

The “all ones” bit pattern that masks the The “all ones” bit pattern that masks the network portion of an IP addressnetwork portion of an IP address

Class A address default: 255.0.0.0Class A address default: 255.0.0.0 Class B address default: 255.255.0.0Class B address default: 255.255.0.0 Class C address default: 255.255.255.0Class C address default: 255.255.255.0

Page 28: TCP/IP Basics

TCP/IP

Examples on Subnet Mask and Supernets

Examples on Subnet Mask and Supernets

See pp203-205 of the recommended readingSee pp203-205 of the recommended reading

Page 29: TCP/IP Basics

TCP/IP

Dynamic Host Configuration Protocol (DHCP)

Dynamic Host Configuration Protocol (DHCP)

A TCP/IP protocol that allows automatic IP A TCP/IP protocol that allows automatic IP addresses and subnet mask assignmentaddresses and subnet mask assignment

Major benefit is ease with which computers Major benefit is ease with which computers can be movedcan be moved

Not suitable for systems that require a static Not suitable for systems that require a static address, such as web serversaddress, such as web servers

A dedicated host, which can be a router or a A dedicated host, which can be a router or a computer, to take the role of DHCP servercomputer, to take the role of DHCP server

Page 30: TCP/IP Basics

TCP/IP

ReadingsReadings

http://www.wown.com/j_helmig/tcpip.htmhttp://www.wown.com/j_helmig/tcpip.htm http://www.yale.edu/pclt/COMM/TCPIP.HTMhttp://www.yale.edu/pclt/COMM/TCPIP.HTM http://www.ii.uib.no/~magnus/TCP-1.html http://www.ii.uib.no/~magnus/TCP-1.html

http://www.pcsupportadvisor.com/search/c04100.htmhttp://www.pcsupportadvisor.com/search/c04100.htm


Recommended