30
07/04/22 ©2007 Scott Miller, University of Victoria 1 Introduction to Introduction to Networking Networking Networking Basics Protocols OS and Networking Rev. 2.0

9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

Embed Size (px)

Citation preview

Page 1: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria1

Introduction to NetworkingIntroduction to NetworkingNetworking BasicsProtocolsOS and Networking

Rev. 2.0

Page 2: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria2

Introduction to NetworkingIntroduction to Networking

Networking: Collection of Hosts, who are all able to communicate with each other

Comprised of many hardware and software layers– Wires - Antennae - OS awareness– Networking adapters - Routers/Gateways– Drivers - Switches - Fiber Optics– Protocols - 3rd Party Applications– AND MUCH MORE

Page 3: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria3

Important BackgroundImportant 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

Page 4: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria4

Common Network Setups Common Network Setups NODE A

PC Modem RoutersSwitchesGateway

Server workingAs

Serial Cable Fiber Optics

Proxy Server

NODE B

PC Ethernet Card

PCI Slot 100Base-T

Page 5: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria5

Common Network Setups Common Network Setups

PC Switch/Router Subnet Server ISP Server

Other Telecom Backbones

CompanyGateway

RouterSwitch(es)

Destination PC

What is common to all these components?

SOFTWARE PROTOCOL

Page 6: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria6

Network Software (HW)Network Software (HW)

Ethernet – Nodes all talk in parallelToken Ring – HW only active when node

has a “token”PPP (modem) – Dedicated HW connection

between 2 nodesFDDI – Multi-token (high speed) fiber-

optic ringWIFI – Wireless networking

Page 7: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria7

Network Software (Protocols)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

Page 8: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria8

Protocol Stack ExampleProtocol Stack Example

Page 9: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria9

Common Elements Between Common Elements Between ProtocolsProtocolsComputer labeling

– AddressingPackets swapped between systemsLayers

– Protocol Stack* Hardware Neutrality *

Page 10: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria10

OS NetworkingOS 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

Ever try and network DOS or Win95?

Page 11: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria11

PortsPorts

Port: An interface to connect a device on a computer– Point of interest: Memory Mapped vs.

Dedicated I/OConsists of a physical address vector – a

port is a physical addressWhen talking about TCP/IP: logical

address

Page 12: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria12

Sockets 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)

Page 13: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria13

Client/Server NetworksClient/Server Networks

Different Network types– Peer to Peer: Bit Torrent, Napster, etc– Client/Server: FTP, HTTP, game servers– Mainframe

Not actually a network, but has the cabling and user/device sharing of a network

Page 14: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria14

Client/Server NetworksClient/Server Networks

Dedicated space = easier backupBetter traffic managementEasier software administration

– Served off of one (or few) central source(s)Dedicated machines for certain functions

Page 15: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria15

TCP/IPTCP/IPIPTCPTCP/IP as a system

Rev. 2.0

Page 16: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria16

Introduction to TCP/IPIntroduction to TCP/IP

TCP/IP is a non-HW dependent protocolInternet ≠ internet (intranet)

– Internet = inter-networking: Networked groups of networks

– internet = intranet = LAN using TCP/IPOpen protocol (not proprietary)

– No specific vendorsLayered as a Stack

Page 17: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria17

Introduction to TCP/IPIntroduction 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

Page 18: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria18

TCP/IP StackTCP/IP Stack

Application Layer

Transport Layer

Internetworking Layer

Link Layer

HTTP, VoIP, IM, FTP, IRC

TCP, UDP, RTP

IP, IMCP

Ethernet, WIFI, Token Ring

Page 19: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria19

TCP/IP StackTCP/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

TCP

IP

Link

TCP

IP

Link

Computer A Computer B

RouterSignal Signal

Page 20: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria20

IP (Internet Protocol)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

Looks for packets addressed to the node and roughly assembles them

Page 21: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria21

TCP (Transmission Control TCP (Transmission Control Protocol)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

Page 22: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria22

UDP (User Datagram Packet)UDP (User Datagram Packet)

Higher layer (transport layer)Like postal service; drop it in system and

hope it finds its way thereNo dedicated path

– No timing - packets can arrive out of orderNo error checking – no confirmation of

receiptGood for streaming multimedia

Page 23: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria23

Common TCP/IP Apps.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: 23E-mail: This doesn’t need a definition…

– SMTP (Simple Mail Transfer Protocol)Sending mailCommon port: 25

Page 24: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria24

Common TCP/IP Apps.Common TCP/IP Apps.– POP: Post Office Protocol

Current version: POP3Checking and Downloading e-mailDownloads all mail in 1 shot from server before

can be viewedCommon Port: 110

– IMAP: Internet Message Access ProtocolCurrent version: IMAP4Local Directory StructureAllows selection of messages from server for

downloading – local copies are kept

Page 25: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria25

Server ConsiderationsServer 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

Page 26: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria26

Stateful vs. StatelessStateful 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

Page 27: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria27

Server ConsiderationsServer Considerations

Servers not only send messages through a protocol, but:– They provide data storage (FTP, E-mail)– Can keep track of session (if stateful)

Page 28: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria28

Typical Internet Client/Server Typical Internet Client/Server FlowFlow1. Client opens a socket (address and port)

to a waiting server2. Server accepts the request3. Client acknowledges and sends a

command4. Server sends a response5. Repeat 3,46. Client sends command to end session –

IF the session is stateful

Page 29: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria29

GUI TCP/IP Apps.GUI TCP/IP Apps.

GUIs only hide command-line protocol details from user– E.g. Outlook

GUI

Winsock

IP

SMTP

POP3

IMAP

Protocols

Request

Routable Packets

TCP

Page 30: 9/12/2015 ©2007 Scott Miller, University of Victoria 1 Introduction to Networking Networking Basics Protocols OS and Networking Rev. 2.0

04/21/23©2007 Scott Miller, University of Victoria30

Reading for Next ClassReading 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!