PPT - University of Victoria

Download Report

Transcript PPT - University of Victoria

Introduction to Networking
Networking Basics
Protocols
OS and Networking
Rev. 2.0
©2007
Scott Miller, University of Victoria
1
4/1/2016
Introduction to Networking
Networking: Collection of Hosts, who are
all able to communicate with each other
 Comprised of many hardware and software
layers

–
–
–
–
–
©2007
Wires
- Antennae - OS awareness
Networking adapters
- Routers/Gateways
Drivers
- Switches - Fiber Optics
Protocols
- 3rd Party Applications
AND MUCH MORE
Scott Miller, University of Victoria
2
4/1/2016
Important Background







Late 50’s/Early 60’s: Beginning of multi-user
computing
1961: Packet sharing conceptualized
1962: Networking demonstrated, but not efficient
enough to work as is
1969: ARPANET (predecessor of the internet)
gets its first 2 nodes – later in year 2 more
1971: First protocol (NCP) employed –
applications can now be introduced
1972: E-mail invented
1983: TCP/IP pronounced ARPANET standard
©2007
Scott Miller, University of Victoria
3
4/1/2016
Common Network Setups
NODE A
Serial Cable
PC
Fiber Optics
Routers Server working
Switches
As
Gateway

Modem
NODE B
PCI Slot
PC
©2007
100Base-T
Ethernet Card
Scott Miller, University of Victoria
Proxy Server
4
4/1/2016
Common Network Setups
PC
Switch/Router
Switch(es)
Router
Subnet Server
Company
Gateway
ISP Server
Other Telecom
Backbones
Destination PC
What is common to all these components?
SOFTWARE PROTOCOL
©2007
Scott Miller, University of Victoria
5
4/1/2016
Network Software (HW)
Ethernet – Nodes all talk in parallel
 Token Ring – HW only active when node
has a “token”
 PPP (modem) – Dedicated HW connection
between 2 nodes
 FDDI – Multi-token (high speed) fiberoptic ring
 WIFI – Wireless networking

©2007
Scott Miller, University of Victoria
6
4/1/2016
Network Software (Protocols)
Was very proprietary – NCP, Netware
(IPX/SPX), OS/2, NetBIOS
 TCP/IP was freely available to encourage
information sharing
 TCP/IP now dominant enough to dictate
HW and firmware designs

©2007
Scott Miller, University of Victoria
7
4/1/2016
Protocol Stack Example
©2007
Scott Miller, University of Victoria
8
4/1/2016
Common Elements Between
Protocols

Computer labeling
– Addressing
Packets swapped between systems
 Layers

– Protocol Stack

* Hardware Neutrality *
©2007
Scott Miller, University of Victoria
9
4/1/2016
OS Networking

Current OS try and make networking
easier
–
–
–
–
Provide current protocols natively
Provide API to handle networking easily
Use sockets and ports
Advanced OS have been optimized
to make networking almost
automatic

©2007
Ever try and network DOS or Win95?
Scott Miller, University of Victoria
10
4/1/2016
Ports

Port: An interface to connect a device on a
computer
– Point of interest: Memory Mapped vs.
Dedicated I/O
Consists of a physical address vector – a
port is a physical address
 When talking about TCP/IP: logical
address

©2007
Scott Miller, University of Victoria
11
4/1/2016
Sockets

OS method of opening a port
– Add a socket to a port to connect over network

Socket is like the end of a pipeline
allowing a direct connection (via a port)
©2007
Scott Miller, University of Victoria
12
4/1/2016
Client/Server Networks

Different Network types
– Peer to Peer: Bit Torrent, Napster, etc
– Client/Server: FTP, HTTP, game servers
– Mainframe

©2007
Not actually a network, but has the cabling and
user/device sharing of a network
Scott Miller, University of Victoria
13
4/1/2016
Client/Server Networks
Dedicated space = easier backup
 Better traffic management
 Easier software administration

– Served off of one (or few) central source(s)

Dedicated machines for certain functions
©2007
Scott Miller, University of Victoria
14
4/1/2016
TCP/IP
IP
TCP
TCP/IP as a system
Rev. 2.0
©2007
Scott Miller, University of Victoria
15
4/1/2016
Introduction to TCP/IP
TCP/IP is a non-HW dependent protocol
 Internet ≠ internet (intranet)

– Internet = inter-networking: Networked
groups of networks
– internet = intranet = LAN using TCP/IP

Open protocol (not proprietary)
– No specific vendors

Layered as a Stack
©2007
Scott Miller, University of Victoria
16
4/1/2016
Introduction to TCP/IP
Uses packet switching (instead of circuit
switching)
 Built into OS so that every program
doesn’t need to code it in

– Thin Client
©2007
Scott Miller, University of Victoria
17
4/1/2016
TCP/IP Stack
Application Layer
Transport Layer
Internetworking Layer
Link Layer
©2007
Scott Miller, University of Victoria
HTTP, VoIP, IM, FTP, IRC
TCP, UDP, RTP
IP, IMCP
Ethernet, WIFI, Token Ring
18
4/1/2016
TCP/IP Stack

Each Layer can only talk to Layer below
– Adds headers and data so each layer can be
reconstructed on other side of connection
Computer A
Computer B
TCP
TCP
IP
IP
Link
©2007
Signal
Router
Scott Miller, University of Victoria
Signal
Link
19
4/1/2016
IP (Internet Protocol)


Specific protocol definition that allows data to be
sent and received through Internetworking
Provides constraints and definitions for packets
to be switched
– Constraints open enough to allow “higher layer
protocols” to add their own information
– Break higher level protocol messages into routable
packets
– Simple “blind” protocol

©2007
Looks for packets addressed to the node and roughly
assembles them
Scott Miller, University of Victoria
20
4/1/2016
TCP (Transmission Control
Protocol)

Establishes direct connection between
client and server
– Like a pipeline; FIFO ordering
– Can have proxies in between
Serious overhead involved with adding
TCP packet information
 Adds reliable error-checking, timing,
ensures data is sent/received
 STREAM!: Sequential data

©2007
Scott Miller, University of Victoria
21
4/1/2016
UDP (User Datagram Packet)
Higher layer (transport layer)
 Like postal service; drop it in system and
hope it finds its way there
 No dedicated path

– No timing - packets can arrive out of order
No error checking – no confirmation of
receipt
 Good for streaming multimedia

©2007
Scott Miller, University of Victoria
22
4/1/2016
Common TCP/IP Apps.

Telnet: Connect to a remote *NIX shell
– Run commands as if you were actually at the
server’s keyboard
– PROTOCOL DEFINES: text strings are sent
one line at a time
– Common port: 23

E-mail: This doesn’t need a definition…
– SMTP (Simple Mail Transfer Protocol)
Sending mail
 Common port: 25

©2007
Scott Miller, University of Victoria
23
4/1/2016
Common TCP/IP Apps.
– POP: Post Office Protocol
Current version: POP3
 Checking and Downloading e-mail
 Downloads all mail in 1 shot from server before
can be viewed
 Common Port: 110

– IMAP: Internet Message Access Protocol
Current version: IMAP4
 Local Directory Structure
 Allows selection of messages from server for
downloading – local copies are kept

©2007
Scott Miller, University of Victoria
24
4/1/2016
Server Considerations
Most TCP/IP based client/server
interactions make use of command-line
requests and responses
 Servers run “forever”

– Constantly poll port for client connection
– Should allow for multiple clients

Stateful vs. Stateless
©2007
Scott Miller, University of Victoria
25
4/1/2016
Stateful vs. Stateless

Stateful: “Memory” of session; Interactive
–
–
–
–

Server/client have record of session
Usually includes authentication
Know what has been/yet to be done
FTP, IRC, Telnet
Stateless: No memory of session
– Individual requests/responses sent
– Simple to implement
– Each request requires more information as nothing
can be compared to older commands
©2007
Scott Miller, University of Victoria
26
4/1/2016
Server Considerations

Servers not only send messages through a
protocol, but:
– They provide data storage (FTP, E-mail)
– Can keep track of session (if stateful)
©2007
Scott Miller, University of Victoria
27
4/1/2016
Typical Internet Client/Server
Flow
1.
2.
3.
4.
5.
6.
©2007
Client opens a socket (address and port)
to a waiting server
Server accepts the request
Client acknowledges and sends a
command
Server sends a response
Repeat 3,4
Client sends command to end session –
IF the session is stateful
Scott Miller, University of Victoria
28
4/1/2016
GUI TCP/IP Apps.

GUIs only hide command-line protocol
details from user
– E.g. Outlook
IMAP
POP3
Protocols
GUI
Winsock
TCP
Request
Routable Packets
IP
…
…
©2007
SMTP
Scott Miller, University of Victoria
29
4/1/2016
Reading for Next Class

Familiarize yourselves with Java and Java
API (for help)

NEXT CLASS: Practical Introduction to
OOP, Java and Preparing for Assignment 1
and Lab1 part 2!
©2007
Scott Miller, University of Victoria
30
4/1/2016