april 1999computer networks/habib youssef1 the internet and tcp/ip habib youssef, ph.d....

92
1999 April / Computer Networks Habib You ssef 1 The Internet and TCP/IP Habib Youssef, Ph.D. [email protected] Department of Computer Engineering King Fahd University of Petroleum & Minerals Dhahran, Saudi Arabia

Post on 22-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 1

The Internet and TCP/IP

Habib Youssef, Ph.D.

[email protected] of Computer Engineering King Fahd University of Petroleum &

MineralsDhahran, Saudi Arabia

Page 2: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 2

TCP/IP and the Internet

TCP and IP are two of the suite of data communication protocols used on the Internet.

IP: Internet Protocol.

TCP: Transmission Control Protocol.

All hosts connected to the network must speak TCP/IP.

Page 3: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 3

Popularity of TCP/IP » simpler than OSI-ISO standard» provides an elegant solution to world

wide data communication. Open Protocol Standards, freely

available, and independent from any hardware platform.

TCP/IP Features

Page 4: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 4

TCP/IP Features (contd.)

Independence from specific network hardware» Allows TCP/IP to integrate many types of networks

(Ethernet, Token Ring, X.25)» TCP/IP is used in both LANs/ and WANs» Supports dial-up connectivity

Common addressing scheme» every TCP/IP host has a unique address

Standardized high-level protocols for world wide available network services

Page 5: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 5

TCP/IP Protocol Architecture

Layered architecture

Application Layer

Transport Layer

Internet Layer

Network Access Layer

Physical Layer

Message

Fragment

Packet

Frame

Signal

Page 6: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 6

Application Layer

Includes all software programs that use the Transport Layer protocols to deliver data messages

Examples of protocols:» Telnet: Network Terminal Protocol» FTP: File Transfer Protocol» SMTP: Simple Mail Transfer Protocol» DNS: Domain Name Service» WWW: World Wide Web

Page 7: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 7

Transport Layer

Interface between the Application and Internet layers

Two main protocols» Transmission Control Protocol (TCP)

– Provides reliable end-to-end data delivery service

» User Datagram Protocol (UDP)– Provides low overhead connection-less

datagram delivery service

Page 8: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 8

Internet Layer

Heart of TCP/IP» Provides basic packet delivery service on

which TCP/IP networks are built Main functions

» Defines datagram, basic unit of transmission in the Internet

» Provides Internet addressing» Routing of datagrams» No error control

Page 9: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 9

Internetworking (cont.) Internet Gateways/Routers are used to connect networks

together. Gateways have knowledge of internet topology Gateways route packets based on destination network not

on destination host

GG G

G

Page 10: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 10

Internetwork Addressing Each device on a network or an

internetwork is identified by a unique address, often called a device or node address.

These addresses are frequently hard-coded into the network hardware.

Each Ethernet and Token-Ring interface possesses a 48-bit address guaranteed to be unique throughout the world.

2-10

Page 11: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 11

A local delivery mechanism enables devices to place messages on the medium and retrieve messages that are addressed to them.

This local delivery is performed by using the device address.

The local delivery is handled by the physical and data link layers.

2-11

Page 12: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 12

Simple Addressing

On simple networks, delivery of messages between devices is simple.

A B C

From: ATo: C

2-12

Page 13: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 13

A mechanism is also needed to deliver messages that must cross network boundaries and travel through the internetwork.

Internetworks can be very complex, so there must be a way to find out the best possible path from one node to another across the internetwork.

This process of finding the best possible paths is referred to as routing.

2-13

Page 14: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 14

TCP/IP-based Internetworks

TCP/IP provides an excellent and simple approach with the widest acceptance.

TCP/IP consists of the layers above and including the network layer.

The lower layers (physical and data link) can be of many types, such as Ethernet, Token-Ring, X.25, Frame Relay, ATM, Serial Line, etc.

2-14

Page 15: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 15

TCP/IP was designed explicitly without data link and physical layer specifications because the goal was to make it adapt to most types of physical media.

TCP/IP relies on the physical layer to deliver messages on the local network.

For delivering messages across network boundaries, TCP/IP has its own addressing mechanism.

2-15

Page 16: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 16

This mechanism works at the network layer, and is handled by the IP (Internet Protocol) software.

In TCP/IP terminology, any device that is connected to the network is referred to as a host.

A host may be a computer, router, network printer, etc.

2-16

Page 17: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 17

Local Message Delivery

When IP sends a message that is directed to a device on the local network, it hands the message over to the physical layer software which tags the message with the physical address of the recipient, and sends it.

The device that matches the physical address retrieves the message.

2-17

Page 18: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 18

Message Routing

When a message is not destined for a device on the local network, it must be routed.

TCP/IP assigns an address to each host and to each network.

Each host is configured with a default router to which it sends messages that must be sent to a remote network.

2-18

Page 19: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 19

A

Router-1

Router-2

Router-3

A B C

D E

E F

Page 20: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 20

The responsibility of determining how messages should be addressed is one of the tasks of the IP layer.

IP identifies whether a message is destined for a host on the local network or it should be sent to the default router.

It makes use of addresses called IP addresses to logically identify networks and hosts.

2-20

Page 21: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 21

The physical address of either a local host or the default router is added by the physical layer software to each message that is sent.

IP receives data from the higher level protocols, and attaches to each data segment a header containing addressing information.

2-21

Page 22: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 22

The combination of data from higher layers with the IP header is referred to as a packet.

Determining routing paths between routers is usually the responsibility of one of the following two protocols.» Routing Information Protocol (RIP)» Open Shortest Path First (OSPF)

2-22

Page 23: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 23

Important questions

How are the machines addressed?

How do internet (IP) addresses relate to physical addresses?

How do internet gateways learn about routes?

Page 24: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 24

Internet addresses

Internet is a universal communication system that uses a globally accepted addressing scheme to identify hosts connected to it.

IP addresses uniquely identify each host

Internet addressing helps TCP/IP software hide physical network details

Page 25: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 25

Internet addresses (cont.)

Names, addresses, and routes refer to successively lower level representations of host identifiers» A name identifies what an object is,» its address identifies where it is, and» a route indicates how to get to it

TCP/IP addressing scheme analogous to physical network addressing

Page 26: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 26

Internet addresses (cont.)

Each Internet host is assigned a 32-bit integer address called its Internet address or IP address

The integers are carefully structured for efficient routing

IP address = {Net-ID, Host-ID} Gateways base routing on Net-ID

Page 27: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 27

Internet addresses (cont.)

32-bit address number specified in each IP datagram» Written as 4 decimal numbers separated

by dots (dotted quad notation)» Each number is from 0-255» Example: razi 196.15.69.230

Number of bits used for Net-Id and for Host-Id depends on class of IP address

Page 28: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 28

Classes of IP addresses

Class A: Used for the very few large networks with more than 216

hosts.First byte < 128

0 1 2 7 8 31

0 Net-ID Host-ID

Page 29: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 29

Classes of IP addresses (cont.)

Class B: For medium size networks that have between 28 and 216 hosts

First byte is from 128 to 191

0 1 2 15 16 31

1 Net-ID Host-ID0

Page 30: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 30

Classes of IP addresses (cont.)

Class C: Small network < 28

hosts

First byte is from 192 to 223

0 1 2 23 24 31

1 Net-ID Host-ID01

3

Page 31: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 31

Internet addresses (cont.)

IP address» Not a host address» Each network interface has an IP address» Each IP address specifies a connection to

a network not an individual machine A gateway connecting N networks

has N distinct IP addresses, one for each physical network connection

Page 32: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 32

Special Addresses

Net-Id = 0, Host-Id = 0» Designates this host» Allowed only at startup

Net-Id = 0» Host on this net» Allowed only at startup

Page 33: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 33

Special Addresses (cont.)

IP address all 1’s» Limited broadcast » Never a valid source address

Host-Id = all 1’s» Broadcast address» Never a valid source address

Page 34: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 34

Special Addresses (cont.)

Net-Id = 127» Loopback address (Class A address)» Used for testing» Interprocess communication on local

host» Allows local host to be addressed in

the same manner as a remote host» Should never appear on a network

Page 35: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 35

Weaknesses of IP addressing

Addresses refer to physical connections not to hosts» This disallows computer mobility

because the IP address assigned to that computer also identifies the network it is attached to

» If a host moves from one network to another, its IP address must be changed

Page 36: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 36

Weaknesses of IP addressing (cont.)

When any Class C network grows to more than 255 hosts, it must have its address changed to a Class B address

Routing decisions are made on the basis of the Net-Id part of IP address» The path taken by packets traveling to a

host with multiple IP addresses depends on the IP address used

Page 37: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 37

Weaknesses of IP addressing (cont.)

If connection of Host B to Network 1 fails, users on Host A who specify IP4 can no longer reach B, where those that specify IP1 can still reach Host B

Network 2

Network 1

IP5

IP4IP3IP1

IP2

Gateway Host A Host B

Page 38: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 38

Internet Addressing Authority

All internet addresses are assigned by a central authority:The network Information Center (NIC)

The NIC assigns the Net-Id portion» Small networks (< 255 hosts) are assigned Class

C addresses, since many LANs are expected» Large networks are assigned Class A addresses

since only few such networks are expected

Page 39: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 39

Example

Ethernet 128.10.0.0 (Class B)

ProNet-10

(Class C)192.5.48.0

192.5.48.6

192.5.48.7

128.10.2.26128.10.2.70128.10.2.8128.10.2.3

10.2.0.37

ToArpanet10.0.0.0

192.5.48.1

192.5.48.3

Page 40: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 40

Mapping IP Addresses to Physical Addresses

How does a machine map its IP address to its physical network address?» Example:

– Machines A and B connected to the same network, with IP addresses IA and IB and physical addresses PA and PB.

– Suppose A has has only B’s IP address, then how does A map IB to PB?

Page 41: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 41

Address Resolution

Some protocol suites adopt one of the following:» Keep mapping tables in each machine» Hardware (physical) addresses are

encoded in the high level addresses

Both are ad-hoc, awkward solutions

Page 42: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 42

Resolution Through Dynamic Binding

Ethernet uses 48-bit physical addresses» Addresses assigned by manufacturers» Replacing a faulty interface card meant a

change to the machine physical address Can’t encode 48-bit long address into a

32-bit long IP address TCP/IP solution: Address Resolution

Protocol (ARP)

Page 43: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 43

ARP

Exploits broadcast capability of Ethernet

Allows a host to find the Ethernet address of a target host on the same network, given the target’s IP address

Builds and maintains dynamically a table to translate IP addresses into Ethernet physical addresses

Page 44: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 44

ARP (cont.)

BAYX Z

ARP_Request{[IA,PA], IB}

ARP_Reply{[IB,PB], [IA, PA]}

Page 45: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 45

ARP (cont.)

Hosts that use ARP maintain a small cache of recently acquired (IP,P) address bindings

Cache is updated dynamically» Timer for each entry» Whenever a new binding is received,

update the corresponding table entry and reset the associated timer

Page 46: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 46

Determining an IP Address at Startup

Diskless machines use IP addresses to communicate with the file server

Also, many diskless machines use TCP/IP FTP protocols to obtain their initial boot image, thus requiring that they obtain and use IP addresses

Designers keep both the bootstrap code and initial OS images free from specific IP addresses for portability

Page 47: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 47

Determining an IP Address at Startup (cont.)

How does a diskless machine determine its IP address?

When bootstrap code starts execution on a diskless machine, it must use the network to contact a server to obtain the machine’s IP address

Usually, a machine’s IP address is kept on disk where OS finds it at startup

Page 48: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 48

Reverse Address Resolution Protocol (RARP)

RARP is the protocol used to solve the reverse problem solved by ARP» Given a physical address, get the

corresponding IP address RARP uses the same message

format as ARP RARP messages are sent

encapsulated in Ethernet frames

Page 49: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 49

RARP (cont.)

RARP allows a host to ask about an arbitrary target» The sender supplies its HA separate from the target

HA, and the server is careful to reply to the sender’s HA

DAYX C

RARP_Requests RARP_Replies

RARP Server RARP Server

Page 50: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 50

TCP/IP-Based Applications

Remote Login (TELNET)

Page 51: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 51

TELNET (cont.)

Internet services are provided through application level programs

Telnet is a Terminal emulation application program.

Allows a user to remote-login on to another computer.

Page 52: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 52

TELNET (cont.)

TELNET » Allows a user at one site to establish a TCP

connection to a login server at another TELNET client software allows the user to specify a

remote machine by giving its domain name or IP address

» Passes keystrokes from the user terminal (client site) to the remote machine (server)

» Carries output from the remote machine back to the user’s terminal

Page 53: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 53

TELNET (cont.)

TELNETClient

OperatingSystem

TELNETServer

OperatingSystem

TCP/IPInternet

Client sendsto server

Server receivesfrom client

Client readsfrom terminal

Server sendsto pseudoterminal

Page 54: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 54

TELNET (cont.)

To accommodate heterogeneity, Telnet defines how data and commands are sent across the Internet. The definition is known as the Network Virtual Terminal (NVT)

Page 55: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 55

TELNET (cont.)

Use’sterminal

Client

Client systemformat used

Server

Server’ssystem

Server’s systemformat used

TCP connection acrossthe Internet

NVT format used

Page 56: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 56

TCP/IP-Based Applications

File Transfer & Access

Page 57: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 57

File Transfer

A facility to access files on remote machines FTP is the major TCP/IP file transfer

protocol File transfer is among the most frequently

used TCP/IP applications Anonymous downloading of files.

Page 58: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 58

File Access Model

Like most other servers, most FTP implementations allow concurrent access to multiple clients» Clients use TCP to connect to the server

– Control connection carries commands telling the server which file to transfer

– Data transfer connection carries data transfers

» A single master server process awaits connections and creates a slave process to handle each connection

Page 59: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 59

File Access Model (cont.)

Controlprocess

OperatingSystem

Controlprocess

OperatingSystem

TCP/IPInternet

Client controlconnection

Server controlconnection

Server dataconnection

Datatransfer

Datatransfer

Client dataconnection

Client System Server System

Page 60: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 60

TCP Port Number Assignment

When a client forms a connection to a server» The client uses a random, locally assigned, protocol

port number» But, the client contacts the server at a well known

port number (Port 21) Once the control connection is established,

future TCP connections established for data transfers use other port numbers on the client machine, and Port 20 on the server machine

Page 61: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 61

User’s View of FTP

FTP viewed as an interactive system

Once invoked, a client performs the following operations repeatedly» Read a line of input» Parse the line and extract command

and its arguments» Execute the command

Page 62: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 62

Example of FTP Session

% ftp spice.ccse.kfupm.edu.sa -- Invokes ftp……..……..

Name (spice:youssef) CRPassword: *****CRftp> help CR -- lists various ftp commandsftp> help bellbell beep when command completedftp> bellBell mode onftp> ls -- lists remote directory

……..

Page 63: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 63

Example of FTP Session (cont.)

ftp> cd shortcourse/tcpip -- move to indicated directory……..

ftp> get RemoteFile LocalFile……..

ftp> put Localfile RemoteFile……..

ftp> close……..

ftp> quit%

Page 64: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 64

TCP/IP-Based Applications

Electronic Mail

Page 65: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 65

Introduction

Email is the first encounter of users with computer networks

Millions connected to the Internet use it. Low cost and fast communication. Encourages collaboration. "A person ... can say HELP to 10,000

people ... The next morning he may have 15 answers to his problem."

Page 66: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 66

Introduction (cont.)

E-mail is delivered in few minutes.

E-mail costs half that of regular postal mail (SNAIL MAIL) and ONLY 15% that of Fax.

Page 67: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 67

Email address

[email protected]

youssef : User name

@ : Connects the who to where

ccse : subdomain name

kfupm : domain

edu : segment type

sa : final where segment (sa= Saudi Arabia, tn= Tunisia, ca: Canada)

Page 68: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 68

Spooling

Mail systems use Spooling technique to handle delayed delivery» When a user sends a message, the system

places a copy in its private storage (spool) area along with the identification of sender, recipient, dest machine, and time of deposit

» The transfer is initiated in the background, allowing the sender to proceed with other activities

Page 69: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 69

Conceptual Components of an Email System

Outgoing mailspool area

Mailboxes forincoming mail

Client(background

transfer)

Server(to accept

mail)

UserInter-face

TCP connectionUser sends mail

User reads mail

for outgoing mail

for incoming mail

TCP connection

Page 70: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 70

Email concepts (cont.)

The background mail transfer process becomes a client » It maps the dest machine name to an IP

address» It forms a TCP connection to the mail

server on dest machine» It passes a copy of the message to the

remote server, which stores a copy in the remote’s system spool area

Page 71: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 71

Email concepts (cont.)

» Once the client and server agree that the copy has been accepted and stored, the client removes the local copy

» If TCP connection fails, the transfer process records the time it tried delivery and terminates

Page 72: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 72

Email concepts (cont.)

» The background transfer process sweeps through the spool area periodicallyFor each undelivered or new outgoing mail– It attempts delivery again– If a mail message cannot be delivered

after an extended time (3 days), it returns the mail message to the sender

Page 73: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 73

Mailbox names and Aliases

Users specify» the mail destination machine (usually

the machine’s domain name)» a mailbox at that machine (usually the

user’s login Id) Most systems provide mail

forwarding software that includes alias expansion mechanism

Page 74: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 74

Alias Expansion and Mail Forwarding

A mail forwarder allows the local site to map Ids used in mail addresses to a set of one or more new mail addresses

After a user composes a message and names a recipient» the mail interface consults the local

aliases to perform necessary mappings before passing the message to the delivery system

Page 75: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 75

Conceptual Model of a Mail System

Outgoing mail

spool area

Mailboxes forincoming mail

Client(background

transfer)

Server(to accept

mail)

UserInter-face

TCP connectionUser

sends mail

User reads mail

for outgoing mail

for incoming mail

TCP connection

Alias expansion

and forwarding

Alias database

Page 76: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 76

TCP/IP Standard for Email Service

TCP/IP divides its mail standard into two sets» One standard specifies the format for mail

messages (RFC 822)» The other specifies the details of electronic

mail exchange between two computers This division makes it possible to build mail

gateways to non TCP/IP networks while still using the same format

Page 77: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 77

Standard Format

Headers contain readable text, divided into lines that consist of» a keyword» a colon “:”» a value

Some keywords are required, others are optional, and the rest are uninterpreted

Page 78: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 78

Standard Format (contd.)

Examples

TO: [email protected]: youssefReply to: [email protected]: coe.faculty, se.facultysubject: Farewell party for Dr. Osman

Page 79: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 79

Electronic Mail Addresses

Email addresses have a simple, easy to remember form

local-part@domain-name

domain-name: mail exchanger of the mail destinationlocal-part: address of a mailbox on that machine

[email protected]

Page 80: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 80

Simple Mail Transfer Protocol(SMTP)

SMTP is the standard mail transfer protocol of TCP/IP

SMTP focuses on how the underlying mail delivery system passes messages across a link from one machine to another

SMTP is simple.

Page 81: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 81

Finding Resources on the Internet

Archie.» Used to search for files available via

anonymous ftp.

Gopher.» Friendly menu-driven search tool for

browsing resources and displaying the requested information.

Page 82: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 82

WAIS

WAIS : Wide Area Information Server Software used to index large text files in servers. On the client side, it finds and retrieves

documents in databases, based on user-defined keywords.

Works on an index. The index is searched and the data tied to the index is retrieved.

Page 83: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 83

WWW

WWW: World-Wide Web Hypermedia-based system for storing and

accessing hypermedia documents anywhere on the Internet.

Each Web site has a Web server. Users (clients) access information in a Web

site using a Web browser such as Netscape or Mosaic.

Page 84: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 84

WWW (Cont.)

WWW is the most popular tool to publish on the Internet.

Already all major computer manufacturers, businesses, airlines, embassies, retail stores, etc., have Web pages.

Ex: http://www.kfupm.edu.sa/~youssef http://www.cnn.com

Page 85: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 85

TCP/IP and the Internet

Connecting to the Internet

Page 86: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 86

Requirements

Connecting to the Internet requires the following.» Establishing physical connections to the

Internet » Registering the Internet addressing

scheme » Registering a domain name » Optional types of registration which

might be needed

2-86

Page 87: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 87

Getting Connected

The first thing any organization must do to get connected to the Internet is pick an approved Internet Service Provider .

The InterNIC strongly encourages all interested parties to select an ISP rather than trying to establish a direct link into the Internet.

2-87

Page 88: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 88

Requirements for Full-Service Links

Full-service connections use full-time, dedicated telecommunications circuits between a subscribing organization and an ISP.

At least one Internet Server must be installed at the site to support the primary Internet services such as » electronic mail, file transfer, and information

retrieval using tools like Gopher, WWW, and WAIS.

2-88

Page 89: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 892-89

For small scale connections this server can provide IP routing as well, acting as a gateway between the organization’s local area network and the Internet.

Larger networks will probably need to install a dedicated router instead.

In addition, security concerns might require the installation of a “firewall”.

Page 90: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 90

Types of Links At a minimum most organizations will

require a dedicated analog dialup connection using either the “SLIP” or “PPP” protocols from an Internet Access Provider.

SLIP (the Serial Line Internet Protocol) and PPP (the Point-to-Point Protocol) are two methods to provide an Internet connection over dialup telephone lines.

Higher-speed (i.e., greater bandwidth) connections are available for organizations expecting heavier Internet usage.

2-90

Page 91: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 91

Dedicated Internet Access

LAN

Gateway/Firewall

Router

CSU/DSUInternet

CSU/DSU

2-91

Leased/Dedicated Line

Page 92: April 1999Computer Networks/Habib Youssef1 The Internet and TCP/IP Habib Youssef, Ph.D. youssef@ccse.kfupm.edu.sa Department of Computer Engineering King

April 1999 Computer Networks/Habib Youssef 92

Personal Internet Access

InternetModem

Modem

2-92

Dialup Phone Line