chapter 14 tcp/ip and routing part #1 unix system administration

23
Chapter 14 Chapter 14 TCP/IP and Routing TCP/IP and Routing Part #1 Part #1 Unix System Unix System Administration Administration

Post on 20-Dec-2015

233 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Chapter 14Chapter 14TCP/IP and Routing TCP/IP and Routing

Part #1Part #1

Unix System AdministrationUnix System Administration

Page 2: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

T.C. P’s and I P’sT.C. P’s and I P’s What is TCP/IP?What is TCP/IP? TCP/IP is a networking protocol for TCP/IP is a networking protocol for

transmitting data between computerstransmitting data between computers TCP/IP is a family of protocolsTCP/IP is a family of protocols TCP/IP is the protocol of the InternetTCP/IP is the protocol of the Internet TCP/IP is the default protocol of UNIXTCP/IP is the default protocol of UNIX TCP/IP provides a uniform programming TCP/IP provides a uniform programming

interface to different types of network interface to different types of network hardware that guarantees interoperabilityhardware that guarantees interoperability

Page 3: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

We Are FamilyWe Are Family IP - Internet Protocol which transports IP - Internet Protocol which transports

raw data from one machine to anotherraw data from one machine to another ICMP - Internet Control Message ICMP - Internet Control Message

Protocol provides low-level support for Protocol provides low-level support for IP such as error messages, routing IP such as error messages, routing assistance and “pings”assistance and “pings”

ARP - Address Resolution Protocol which ARP - Address Resolution Protocol which translates logical address (IP address) to translates logical address (IP address) to hardware address (MAC address)hardware address (MAC address)

Page 4: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

All in the FamilyAll in the Family

TCP - Transmission Control Protocol TCP - Transmission Control Protocol uses IP to maintain a uses IP to maintain a connection-connection-orientedoriented sessions between machines sessions between machines that that guarantees deliveryguarantees delivery of data. of data.

UDP - User Datagram Protocol uses UDP - User Datagram Protocol uses IP for IP for connectionlessconnectionless sessions sessions between machine between machine without the without the guaranteeguarantee of data delivery. of data delivery.

Page 5: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

So You Want to Date a So You Want to Date a Model?Model?

The OSI Model by the ISOThe OSI Model by the ISO Seven LayersSeven Layers

– Layer 7 - Application LayerLayer 7 - Application Layer– Layer 6 - Presentation LayerLayer 6 - Presentation Layer– Layer 5 - Session LayerLayer 5 - Session Layer– Layer 4 - Transport LayerLayer 4 - Transport Layer– Layer 3 - Network LayerLayer 3 - Network Layer– Layer 2 - Data Link LayerLayer 2 - Data Link Layer– Layer 1 - Physical LayerLayer 1 - Physical Layer

Page 6: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

The Government Thought The Government Thought OSI Was A Good IdeaOSI Was A Good Idea

The US Government decided all The US Government decided all government computers should use OSIgovernment computers should use OSI

OSI had implementation problemsOSI had implementation problems– Relied on concepts that made no sense in Relied on concepts that made no sense in

modern networksmodern networks– Some specifications were incompleteSome specifications were incomplete– Functionally inferior to existing protocolsFunctionally inferior to existing protocols– Too many layers which made it slowToo many layers which made it slow

Page 7: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Back to Good Ol’ TCP/IP in Back to Good Ol’ TCP/IP in the Good Ol’ US of Athe Good Ol’ US of A

Good enough of government workGood enough of government work TCP/IP has 4 layersTCP/IP has 4 layers

– Layer 4 - Application Layer (think telnet, Layer 4 - Application Layer (think telnet, ftp, http, etc.)ftp, http, etc.)

– Layer 3 - Transport Layer (think Layer 3 - Transport Layer (think TCP/UDP)TCP/UDP)

– Layer 2 - Network Layer (think IP)Layer 2 - Network Layer (think IP)– Layer 1 - Link Layer (think ethernet Layer 1 - Link Layer (think ethernet

card)card)

Page 8: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

How Does it All Fit How Does it All Fit TogetherTogether

Exhibit A from Page 246 in your book

Page 9: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Pack-et In a FramePack-et In a Frame

Data travels the network in a packet Data travels the network in a packet which consists of a payload and which consists of a payload and headersheaders

Packets are sometimes referred to as Packets are sometimes referred to as frames when talking about the low-frames when talking about the low-level transport, (e.g. Ethernet)level transport, (e.g. Ethernet)

The low-level transport may limit the The low-level transport may limit the size of a frame/packet. This is called size of a frame/packet. This is called the MTU - maximum transfer unitthe MTU - maximum transfer unit

Page 10: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Sample PacketSample Packet

Page 11: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

IP on Your MAC Port?IP on Your MAC Port?

Three key addresses determine the Three key addresses determine the source and destination of a packetsource and destination of a packet– MAC - low-level address of network MAC - low-level address of network

hardware. For Ethernet, 6-byte globally hardware. For Ethernet, 6-byte globally unique address.unique address.

– IP - dotted quad-octet assigned to each IP - dotted quad-octet assigned to each network device. Globally unique.network device. Globally unique.

– Port - two-byte number that specifies a Port - two-byte number that specifies a particular service on a machineparticular service on a machine

Page 12: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Mapping IP to MAC Using Mapping IP to MAC Using ARPARP

The ARP protocol is used to map IP The ARP protocol is used to map IP address to MAC addressesaddress to MAC addresses– Machine sends ARP request “Who is Machine sends ARP request “Who is

159.91.15.220?”159.91.15.220?”– The machine or another machine on the The machine or another machine on the

same network will respond same network will respond “00:40:95:21:CB:38 is 159.91.15.220”“00:40:95:21:CB:38 is 159.91.15.220”

– The MAC address is used to make the final The MAC address is used to make the final delivery of the packet to the destination delivery of the packet to the destination machine.machine.

Page 13: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Dotted? Quad? Octet?Dotted? Quad? Octet?

IP AddressIP Address– Octet = 8-bit number (usually we call Octet = 8-bit number (usually we call

this a byte, but old DEC systems used this a byte, but old DEC systems used 7-bit bytes) = values 0-2557-bit bytes) = values 0-255

– octet.octet.octet.octet is the format of octet.octet.octet.octet is the format of an IP address, such as 159.91.15.220an IP address, such as 159.91.15.220

– IP addresses have a structure to their IP addresses have a structure to their assignment, where as, MAC addresses assignment, where as, MAC addresses have no relationship to each otherhave no relationship to each other

Page 14: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

IP Address Have Classes IP Address Have Classes TooToo

There are 5 classes for IP addressesThere are 5 classes for IP addresses– Class A - first octet is assigned as the Class A - first octet is assigned as the

network address, the remaining 3 octets are network address, the remaining 3 octets are available for network devicesavailable for network devices

– Class B - first two octets are assigned as the Class B - first two octets are assigned as the network address, remaining 2 octets are network address, remaining 2 octets are available for network devicesavailable for network devices

– Class C - first three octets are assigned as Class C - first three octets are assigned as the network address, remaining octet is the network address, remaining octet is available for network devicesavailable for network devices

Page 15: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Going Out With ClassGoing Out With Class

The last two IP classes are specialThe last two IP classes are special– Class D - multicast addresses. This is Class D - multicast addresses. This is

the rare case where the multiple the rare case where the multiple machines can have the same IP machines can have the same IP addressaddress

– Class E - experimentalClass E - experimental

Page 16: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

IP Class SummaryIP Class Summary

Class 1st Octet Format

A 1-126 N.H.H.H

B 128-191 N.N.H.H

C 192-223 N.N.N.H

D 224-239 -

E 240-254 -

Page 17: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Who’s The Head of the Who’s The Head of the Classes?Classes?

*NOTE* - the book is out of date about this*NOTE* - the book is out of date about this Today, you typically get your addresses from Today, you typically get your addresses from

your Internet Service Provideryour Internet Service Provider Addresses are ultimately controlled by IANA - Addresses are ultimately controlled by IANA -

Internet Assigned Number Authority. IANA Internet Assigned Number Authority. IANA give certain registries around the globe give certain registries around the globe authority to give out IP addresses. authority to give out IP addresses. www.iana.orgwww.iana.org

ARIN - American Registry for Internet ARIN - American Registry for Internet Numbers handles the Americas. www.arin.netNumbers handles the Americas. www.arin.net

Page 18: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

IP PrivatelyIP Privately

There are private IP addresses set There are private IP addresses set aside for internal use. They are not aside for internal use. They are not routed if they get to the Internet.routed if they get to the Internet.

These private addresses can be used if These private addresses can be used if you setup a standalone network or if you setup a standalone network or if you will be using NAT (Network Address you will be using NAT (Network Address Translation) to translate a private Translation) to translate a private address to a valid public address address to a valid public address before going to the Internet.before going to the Internet.

Page 19: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Still, IP PrivatelyStill, IP Privately

RFC1918RFC1918– http://www.isi.edu/in-notes/rfc1918.txthttp://www.isi.edu/in-notes/rfc1918.txt

– Class A - 10.0.0.0 thru 10.255.255.255Class A - 10.0.0.0 thru 10.255.255.255

– Class B - 172.16.0.0 thru 172.31.255.255Class B - 172.16.0.0 thru 172.31.255.255

– Class C - 192.168.0.0 thru 192.168.255.255Class C - 192.168.0.0 thru 192.168.255.255

Page 20: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

What Service Do You Use What Service Do You Use Your Port For?Your Port For?

A port is the location on a particular machine A port is the location on a particular machine that a service is running on.that a service is running on.

Think of it as room in a house. The house has an Think of it as room in a house. The house has an address (IP), but each room (port) provides a address (IP), but each room (port) provides a certain function.certain function.

Ports below 1024 are called “well known” ports. Ports below 1024 are called “well known” ports. Only root has access to start services on these Only root has access to start services on these ports.ports.

Ports 1024 and above are called “ephemeral” Ports 1024 and above are called “ephemeral” ports. These ports are open to everyone on the ports. These ports are open to everyone on the system.system.

Page 21: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

What’s That In My #2 What’s That In My #2 Port?Port?

Normally, a vendor goes to IANA to get Normally, a vendor goes to IANA to get a port assigned to them for their a port assigned to them for their service to run on. Each service has a service to run on. Each service has a unique port. E.g. - telnet is 23, http is unique port. E.g. - telnet is 23, http is 80.80.

RFC1700 used to keep this list, but is RFC1700 used to keep this list, but is now out-dated.now out-dated.

See http://www.iana.org/numbers.html See http://www.iana.org/numbers.html for the most up-to-date list.for the most up-to-date list.

Page 22: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Why, Why, Y?Why, Why, Y?

Why would you use a private Why would you use a private address with NAT when connecting address with NAT when connecting to the Internet instead of getting to the Internet instead of getting public addresses for each public addresses for each machine?machine?

Why would you use a multicast Why would you use a multicast (class D) address?(class D) address?

Page 23: Chapter 14 TCP/IP and Routing Part #1 Unix System Administration

Coming Soon to a Lecture Coming Soon to a Lecture Near YouNear You

Part #2 - Routing and SubnetsPart #2 - Routing and Subnets