Sie sind auf Seite 1von 48

CT 320: Network and System

Administration
Fall 2014*

Dr. Indrajit Ray


Email: indrajit@cs.colostate.edu

Department of Computer Science


Colorado State University
Fort Collins, CO 80528, USA

*
Thanks to Dr. James Walden, NKU and Russ Wakefield, CSU for contents of these slides

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Introduction to TCP/IP Networking

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Internetworking
Internetwork = Collection of networks
connected via routers

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Internet = Virtual Network

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Some Very Basic Terms
Simple Example: Use web browser to lookup www.cnn.com

My Laptop -
Running web Web Server
browser www.cnn.com
Internet
Internet

My laptop and the web server are both End Systems = Hosts
End systems can also include PDAs, sensors, cell phones, and
generally any device using the network to communicate
End systems are located at the network edge and connected to the
network using communication links

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
More Basic Terms: Client/Server
Simple Example: Use web browser to lookup www.cnn.com

My Laptop -
Running web Web Server
browser www.cnn.com
Internet
Internet

End systems may be classified as client, a server, both, or neither.


Client (runs) some program that requests services:
web browser requests a page, email reader requests messages,
ftp program requests files, etc.
Server (runs) some program that listens for requests and provides services
web server, email server, ftp server, etc.
Client vs. server depends on what programs the end system is running.
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
Sending a packet from Argon to
Neon

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Sending a packet from Argon to
Neon 128.143.71.21 is not on my local network.
Therefore, I need to send the packet to my
128.143.71.21
default gateway withisaddress
on my local network.
128.143.137.1
DNS:
DNS:
ARP:What
The is
WhatIPisthe
address
theIPMAC
address
of Therefore, I can send the packet directly.
neon.tcpip-lab.edu
address
ARP: TheofMAC is of
128.143.137.1?
address
of128.143.71.21
neon.tcpip-lab.edu?
128.143.137.1 is 00:e0:f9:23:a8:20
ARP: What is the MAC
ARP: TheofMAC
address address of
128.143.71.21?
128.143.137.1 is 00:20:af:03:98:28

frame frame

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Communications Architecture
The complexity of the communication
task is reduced by using multiple
protocol layers:
Each protocol is implemented
independently
Each protocol is responsible for a
specific subtask
Protocols are grouped in a hierarchy
A structured set of protocols is called
a communications architecture or
protocol suite

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
TCP/IP Protocol Suite

The TCP/IP protocol suite


Application User-level programs
is the protocol
architecture of the Transport
Internet
Operating system
Network
The TCP/IP suite has four
layers: Application, Data Link
Transport, Network, and
Data Link Layer

End systems (hosts) Data Link Sublayer in


implement all four Local Area
Media Access Networks
layers. Gateways Control (MAC)
(Routers) only have the
bottom two layers.

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
OSI and TCP/IP Protocol Stack

OSI Model TCP/IP Hierarchy Protocols

7th
Application Layer

6th
Presentation Application
Layer Layer
5th
Session Layer

4th
Transport
Transport Layer
Layer
3rd
Network Layer
Network Layer

2nd
Link Layer
Link Layer
1st
Physical Layer

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Functions of the Layers
Data Link Layer:
Service: Reliable transfer of frames over
a link
Media Access Control on a LAN
Functions: Framing, media access control,
error checking
Network Layer:
Service: Move packets from source host
to destination host
Functions: Routing, addressing
Transport Layer:
Service: Delivery of data between hosts
Functions: Connection
establishment/termination, error
control, flow control
Application Layer:
Service: Application specific (delivery of
email, retrieval of HTML
documents, reliable transfer of file)
Functions: Application specific
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
Assignment of Protocols to Layers
ping Application
application
HTTP Telnet FTP DNS SNMP
Layer

TCP UDP Transport


Layer

Routing Protocols

ICMP RIP

Network
IGMP IP PIM
Layer

OSPF
DHCP

ARP Ethernet Data Link


Layer

Network
Interface
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
Layered Communications
An entity of a particular layer can only
communicate with:
1. a peer layer entity using a common
protocol (Peer Protocol)
2. adjacent layers to provide services and
to receive services
N+1 Layer N+1 Layer Protocol N+1 Layer
N+1 Layer
Entity Entity
layer N+1/N
interface
N Layer N Layer Protocol N Layer
N Layer
Entity Entity
layer N/N-1
interface
N-1 Layer N-1 Layer Protocol N-1 Layer
N-1 Layer
Entity Entity

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Layered Communications
A layer N+1 entity sees the lower
layers only as a service provider

N+1 Layer N+1 Layer Peer Protocol N+1 Layer


Entity Entity

Request Indicate
Delivery Delivery

Service Provider

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Application View of Networking
Application job: write the web browser (client) or web server (server)

My Laptop -
Running web Web Server
browser www.cnn.com
Internet
Internet

Assume network provides way to send a messages between hosts.


Dont know or care how the messages are sent.
Do care about:
Does the network provide a connection or is it connectionless?
Are messages reliable?
Who/what provides flow control? (speed of sending messages)

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Transport View of Networking
Transport job: design/implement the connection-oriented(-less) service

Some
Some
Destination
Source
End System
End System
Internet
Internet

Assume application handles message content..


Dont know or care about the content of the messages.
Dont know or care how the messages get from source to destination
Do care about:
How to provide a connection or connectionless service?
How to make the transport connection reliable?
How to handle congestion and flow control in the network?
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
Network Layer View
Network layer job: get a message from a source to a destination

ISP
ISPAA
ISP
ISPBB
ISP
ISPAA

Assume higher layers handle message content, congestion(?), reliability


Do care about:
How to provide a best effort attempt to delivery packets?
Routing!

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Link Layer View of Networking

Link Layer job: get a message sent across some medium

Only care about how to get message from A to B across this link
Link can be twisted pair, coaxial, fiber optic, wireless

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Service Access Points
A service user accesses services of
the service provider at Service
Access Points (SAPs)
A SAP has an address that uniquely
identifies where the service can be
accessed Layer-N
N Layer
Entity

layer N/N-1 Layer


service interface N-1
SAP
N-1 Layer- N-1
Layer Entity

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Exchange of Data
The unit of data sent between peer entities is called
a Protocol Data Unit (PDU)
For now, let us think of a PDU as a single packet

N Layer PDU N Layer


A Entity (at layer N) Entity
B

Scenario: Layer-N at A sends a layer-N PDU to layer-


N at B
What actually happens:
As layer-N passes the PDU to the SAPs at layer-N-1
Layer-N-1 entity at A constructs its own (layer-N-1) PDU
which it sends to the layer-N-1 entity at B
PDU at layer-N-1 = layer-N-1 Header + layer N PDU
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
Exchange of Data
A B

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Layers in the Example

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Layers in the Example

Send HTTP Request


to neon

Establish a connection to 128.143.71.21 at


port 80Open TCP connection to
128.143.71.21 port 80
IP datagram is a TCP
segment for port 80
Send a datagram (which Send IP data-gram
contains to
a connection
Send IP datagram to
128.143.71.21
request) to 128.143.71.21
128.143.71.21
Frame is an IP Frame is an IP
datagram Send the datagram to 128.143.137.1datagram
Send the datagram
to 128.143.7.21

Send Ethernet frame Send Ethernet frame


to 00:e0:f9:23:a8:20 to 00:20:af:03:98:28

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Layers and Services

Service provided by TCP to HTTP:


reliable transmission of data over a logical
connection
Service provided by IP to TCP:
unreliable transmission of IP datagrams across
an IP network
Service provided by Ethernet to IP:
transmission of a frame across an Ethernet
segment

Other services:
DNS: translation between domain names and IP addresses
ARP: Translation between IP addresses and MAC addresses

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Encapsulation
As data is moving down the protocol
stack, each protocol is adding layer-
specific control information
User data

HTTP
HTTP Header User data

TCP
TCP Header HTTP Header User data

IP TCP segment

IP Header TCP Header HTTP Header User data

Ethernet IP datagram

Ethernet Ethernet
IP Header TCP Header HTTP Header User data
Header Trailer

Ethernet frame
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
Ethernet
Computer <-> Computer
communication on same network
Each device has unique MAC address
(48-bit)
example: 00-C0-4F-48-47-93

Ethernet Packet:
Preamble Dest. Source Type Data CRC
address address

8bytes 6bytes 6bytes 2bytes 64 - 1500bytes 4bytes

MAC: Media Access Contro


Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
IP: Internet Protocol
Unreliable connectionless datagram delivery
service
Responsible for routing of data through
intermediate networks and computers

11 1111 1111 2222 2222 2233


IP header: 0123 4567 8901 2345 6789 0123 4567 8901

1 :ICMP
6 :TCP
17 :UDP

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
IP Routing

Source Destination
Application Application
Transport Router Transport
Network Network Network
Link Link Link

Routing Table
Destination IP address
IP address of a next-hop router
Flags
Network interface specification
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
ICMP : Internet Control Message
Protocol
Used to report problems with delivery of IP
Datagrams within an IP network
Used by Ping, Traceroute commands ICMP Message
20bytes 4bytes

IP ICMP ICMP
Header Header Data
Types and Codes
Echo Request (type=8, code=0) Type Code Checksum

Echo Reply(type=0, code=0) 1byte 1byte 2bytes

Destination Unreachable(type=3, code=0)


Time Exceeded(type=11, code=0) : Time-to-Live =0

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
TCP : Transmission Control Protocol
Connection-Oriented, Reliable, Byte Stream
Service
Protocol
1. Set up connection
2. Transfer data
3. TCP
Close connection
Header Format
0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Source Port Destination Port
Sequence Number
Acknowledgement Number
- - - -
Data Window
Offset
Checksum Urgent Pointer
Options (0 to 10 Words of 32 Bits)
TCP Payload

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
IP Addressing: Introduction
IP address: 32-bit 223.1.1.1
identifier for host, 223.1.2.1
router interface 223.1.1.2
interface: 223.1.1.4 223.1.2.9

connection between 223.1.2.2


host/router and 223.1.1.3 223.1.3.27

physical link
routers typically
have multiple 223.1.3.1 223.1.3.2
interfaces
host may have
multiple interfaces
IP addresses
associated with each223.1.1.1 = 11011111 00000001 00000001 0000000
interface
223 1 1 1
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
An Addressing Example

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
IP Addresses
4 8-bit numbers (Hierarchical)
18.26.0.1

network 32-bits host

Specifies both network and host


Number of bits allocated to specify
network varies
Three
A classes: B C

0 net host 1 0 net host 110 net host

1 7 24 bits 2 14 16 bits 3 21 8 bits


Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
IP Addresses
IP (Version 4) Addresses are 32
bits long
IP Addresses Assigned Statically
or Dynamically (DHCP)
IPv6 addresses are 128 bits long

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
IP Address Space
Originally, 3 Classes
A, B, C
Problem
Classes too rigid (C too small, B
too big)
Solution
Subnetting (e.g. within CSU)
Classless Interdomain Routing
(CIDR)

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Subnetting
IP Address plus subnet mask
(netmask)
IP Addr: 171.64.15.82
Netmask: 0xFFFFFF00
(111...1100000000)
First 24 bits are the Subnet ID (the
neighborhood)
Last 8 bits are Host ID (the street
address)
Can be written as Prefix + Length
171.64.15.0/24 or 171.64.15/24

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Subnets
IP address:
subnet part 223.1.1.1
(high order bits) 223.1.2.1
223.1.1.2
host part
223.1.1.4 223.1.2.9
(low order bits)
Whats a subnet ? 223.1.1.3
223.1.2.2
223.1.3.27
device interfaces
with same subnet LAN
part of IP address
223.1.3.1 223.1.3.2
can physically reach
each other without
intervening router
network consisting of 3 subnets

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Subnets 223.1.1.0/24
223.1.2.0/24

Recipe
To determine the
subnets, detach
each interface
from its host or
router, creating
islands of isolated
networks. Each
isolated network 223.1.3.0/24

is called a subnet. Subnet mask: /24

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Subnets
223.1.1.2

223.1.1.1 223.1.1.4

223.1.1.3

223.1.9.2 223.1.7.0

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0

223.1.2.6 223.1.3.27

223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Routers and IP Addressing Principle

Routers have two or more addresses one for


each interface.
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
IP Addressing: CIDR
CIDR: Classless Inter Domain Routing
subnet portion of address of arbitrary
length
address format: a.b.c.d/x, where x is #
bits in subnet portion of address

subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Getting a datagram from source to
dest.
routing table in
Dest. Net.
A next router Nhops
223.1.1 1
223.1.2 223.1.1.4 2
IP datagram: 223.1.3 223.1.1.4 2
misc source dest
data
fields IP addr IP addr A 223.1.1.1
datagram remains 223.1.2.1
unchanged, as it travels 223.1.1.2
223.1.1.4 223.1.2.9
source to destination
B
addr fields of interest 223.1.2.2
223.1.1.3 223.1.3.27 E
here
223.1.3.1 223.1.3.2

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Getting a datagram from source to
dest.

misc Dest. Net. next router Nhops


data
fields 223.1.1.1223.1.1.3
223.1.1 1
223.1.2 223.1.1.4 2
Starting at A, given IP 223.1.3 223.1.1.4 2
datagram addressed to
B: A 223.1.1.1
look up net. address of B
223.1.2.1
find B is on same net. as A 223.1.1.2
link layer will send datagram 223.1.1.4 223.1.2.9
directly to B inside link-layer B
223.1.2.2
frame 223.1.1.3 223.1.3.27 E
B and A are directly
223.1.3.1 223.1.3.2
connected

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
Getting a datagram from source to
dest.

misc Dest. Net. next router Nhops


data
fields 223.1.1.1223.1.2.3
223.1.1 1
223.1.2 223.1.1.4 2
Starting at A, dest. E:
223.1.3 223.1.1.4 2
look up network address of
E
A 223.1.1.1
E on different network
A, E not directly 223.1.2.1
223.1.1.2
attached 223.1.1.4 223.1.2.9
routing table: next hop B
router to E is 223.1.1.4 223.1.2.2
223.1.1.3 223.1.3.27 E
link layer sends datagram
to router 223.1.1.4 inside 223.1.3.1 223.1.3.2
link-layer frame
datagram arrives at
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems223.1.1.4
Administration, Fall 2014
Getting a datagram from source to
dest.
Dest. next
misc network router Nhops interface
data
fields 223.1.1.1223.1.2.3
223.1.1 - 1 223.1.1.4
Arriving at 223.1.4, 223.1.2 - 1 223.1.2.9
223.1.3 - 1 223.1.3.27
destined for 223.1.2.2
look up network address of
A 223.1.1.1
E
E on same network as 223.1.2.1
223.1.1.2
routers interface 223.1.2.9 223.1.1.4 223.1.2.9
router, E directly B
223.1.2.2
attached 223.1.1.3 223.1.3.27 E
link layer sends datagram
223.1.3.1 223.1.3.2
to 223.1.2.2 inside link-
layer frame via interface
223.1.2.9
Dr. Indrajit Ray, Computer Science Department CT 320 Network and
Systems Administration, Fall 2014
datagram arrives at
ARP : Address Resolution Protocol
ARP provides mapping
32bit IP address <-> 48bit MAC address
128.97.89.153 <-> 00-C0-4F-48-47-93
ARP cache
maintains the recent mappings from IP addresses
to MAC addresses

Protocol
1. ARP request broadcast on Ethernet
2. Destination host ARP layer responds

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014
IP addresses: Allocation
Q: How does a host get an IP address?

hard-coded by system admin in a file


Wintel: control-panel->network-
>configuration->tcp/ip->properties
UNIX: /etc/rc.config
DHCP: Dynamic Host Configuration
Protocol: dynamically get address
from as server
plug-and-play

Dr. Indrajit Ray, Computer Science Department CT 320 Network and


Systems Administration, Fall 2014

Das könnte Ihnen auch gefallen