CT 320: Network and System Administration Fall 2014

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 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

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

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

argon.tcpip-lab.edu neon.tcpip-lab.edu
"Argon" "Neon"
128.143.137.144 128.143.71.21

router137.tcpip-lab.edu router71.tcpip-lab.edu
"Router137" "Router71"
128.143.137.1 128.143.71.1

Router

Ethernet Network Ethernet Network

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?
ofneon.tcpip-lab.edu
address
ARP: TheofMAC is of
128.143.137.1?
address
128.143.71.21
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?
argon.tcpip-lab.edu
"Argon"
128.143.137.1 is neon.tcpip-lab.edu
00:20:af:03:98:28
"Neon"
128.143.137.144 128.143.71.21

router137.tcpip-lab.edu router71.tcpip-lab.edu
"Router137" "Router71"
128.143.137.1 128.143.71.1

Router

frame frame

Ethernet Network Ethernet Network

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 is


Application User-level programs
the protocol architecture of
the Internet Transport

Operating system
The TCP/IP suite has four Network
layers: Application, Transport,
Network, and Data Link Layer Data Link

End systems (hosts)


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

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 Layer Application Layer

5th
Session Layer

4th
Transport Layer
Transport 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

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

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 A
ISP B
ISP A

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
Layer-N Layer-N
Entity Layer-N PDU and control data is Entity
sent to SAP of Layer-N-1
control N PDU
SAPs

Layer- N-1 Layer- N-1


Entity Entity

Header
(of layer N-1)
N PDU
control N PDU

PDU of Layer-N-1

Dr. Indrajit Ray, Computer Science Department CT 320 Network and Systems Administration, Fall 2014
Layers in the Example

HTTP HTTP protocol HTTP

TCP TCP protocol TCP

IP IP protocol IP IP protocol IP

Ethernet Ethernet Ethernet Ethernet Ethernet Ethernet

argon.tcpip- router71.tcpip- router137.tcpip- neon.tcpip-lab.edu


lab.edu lab.edu lab.edu 128.143.71.21
128.143.137.144 128.143.137.1 128.143.71.1
00:e0:f9:23:a8:20

Dr. Indrajit Ray, Computer Science Department CT 320 Network and Systems Administration, Fall 2014
Layers in the Example

HTTP Send HTTP Request HTTP


to neon

Establish a connection to 128.143.71.21 at


TCP port 80Open TCP connection to TCP
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
IP IP
Send IP datagram to
128.143.71.21
request) to 128.143.71.21 IP
128.143.71.21
Frame is an IP Frame is an IP
datagram Send the datagram to 128.143.137.1datagram
Send the datagram
Ethernet Ethernet Ethernet Ethernet
to 128.143.7.21

argon.tcpip- router71.tcpip- router137.tcpip- neon.tcpip-lab.edu


Send Ethernet frame Send Ethernet frame
lab.edu 128.143.71.21
to 00:e0:f9:23:a8:20 lab.edu lab.edu
to 00:20:af:03:98:28
128.143.137.144 128.143.137.1 128.143.71.1
00:e0:f9:23:a8:20
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 Control

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. Close connection
TCP 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, router
223.1.2.1
interface 223.1.1.2
interface: connection 223.1.1.4 223.1.2.9

between host/router and 223.1.2.2


physical link 223.1.1.3 223.1.3.27

routers typically have


multiple interfaces
host may have multiple 223.1.3.1 223.1.3.2
interfaces
IP addresses associated
with each interface

223.1.1.1 = 11011111 00000001 00000001 00000001

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 classes:
A 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.3.27
223.1.2.2

device interfaces with


same subnet part of IP LAN
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 is
called a subnet. 223.1.3.0/24

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 A
Dest. Net. 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
IP addr data
fields IP addr A 223.1.1.1

datagram remains unchanged, 223.1.2.1


as it travels source to 223.1.1.2
223.1.1.4 223.1.2.9
destination
B
addr fields of interest here 223.1.2.2
223.1.1.3 223.1.3.27 E

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.1 223.1.1.3
223.1.1 1
223.1.2 223.1.1.4 2
Starting at A, given IP datagram
223.1.3 223.1.1.4 2
addressed to B:
look up net. address of B A 223.1.1.1
find B is on same net. as A
223.1.2.1
link layer will send datagram directly 223.1.1.2
to B inside link-layer frame 223.1.1.4 223.1.2.9
B and A are directly connected
B
223.1.2.2
223.1.1.3 223.1.3.27 E

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.1 223.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
E on different network A 223.1.1.1
A, E not directly attached
223.1.2.1
routing table: next hop router to E 223.1.1.2
is 223.1.1.4 223.1.1.4 223.1.2.9
link layer sends datagram to B
223.1.2.2
router 223.1.1.4 inside link-layer 223.1.1.3 223.1.3.27 E
frame
223.1.3.1 223.1.3.2
datagram arrives at 223.1.1.4
continued..
Dr. Indrajit Ray, Computer Science Department CT 320 Network and Systems Administration, Fall 2014
Getting a datagram from source to dest.

Dest. next
misc network router Nhops interface
data
fields 223.1.1.1 223.1.2.3
223.1.1 - 1 223.1.1.4
Arriving at 223.1.4, destined for 223.1.2 - 1 223.1.2.9

223.1.2.2 223.1.3 - 1 223.1.3.27

look up network address of E A 223.1.1.1


E on same network as routers
223.1.2.1
interface 223.1.2.9 223.1.1.2
router, E directly attached 223.1.1.4 223.1.2.9
B
link layer sends datagram to 223.1.2.2
223.1.2.2 inside link-layer frame 223.1.1.3 223.1.3.27 E
via interface 223.1.2.9 223.1.3.1 223.1.3.2
datagram arrives at 223.1.2.2!!!
(hooray!)
Dr. Indrajit Ray, Computer Science Department CT 320 Network and Systems Administration, Fall 2014
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

You might also like