Intro to Computer Networks

Download Report

Transcript Intro to Computer Networks

This Lecture – Internet Basics
 Basic terms we need to understand.
 The OSI/ISO (Open Systems
Internconnection/International Standards Office)
“layers model” of computer networks.
 The standard model to describe how computer
networks should work.
 The TCP/IP (Transmission Control
Protocol/Internet Protocol) Protocol Stack
 The standard model which is how computer networks
actually work.
Where to go for more information on
this lecture’s subjects
 RFCs: (Requests for Comments): The protocols which
define the internet:
 http://www.rfc-editor.org/
 RFCs define how things work (but some are spurious, some are
out of date and some are just jokes).
 IETF: (Internet Engineering Task Force)
 http://www.ietf.org/
 Related texts:
 Bertsekas/Gallager: Layers Model: Section 1.3 IP: Section
2.8+ 2.9
 Tanenbaum: Layers Model: Section 1.4 IP: Section 5.5
Basic Definitions: Protocol




Protocol: A formal specification of how things should
communicate. In networking a protocol defines an interface
usually (though not necessarily) between one computer and
another.
A simple example of a protocol “Knock and Enter”:
1. Knock on the door.
2. Wait for someone to say “Come in.”
3. If someone says “Come in.” then open the door and enter.
4. If you wait for five minutes then give up.
We might want to combine this with a protocol for saying
“Come in” when you hear a knock.
Two computers need to use the same protocol to talk to one
another. The definition of protocols is critical to networking.
Basic Definitions: Bit, Byte, Octet,
Packet, Header, Bandwidth
 Bit: A 0 or a 1 – the basic unit of digital data.
 Byte: A short collection of bits (usually assumed to be 8
bits – but may, rarely, be 7, 16 or 32).
 Octet: A collection of 8 bits.
 Packet: A collection of bits in order assembled for
transmission.
 Header: Part of packet with info about contents.
 Bandwidth: The amount of data which can be sent on a
channel. Usually bits per second – sometimes in bytes
(octets) per second. (Yes this is confusing.)
 KB = kilobytes. Kb = kilobits.
Basic Definitions: Host, Router,
Switch, Source, Destination
 Host: A machine which is a point on a network
which packets travel through – a node in a graph.
 Router: A host which finds a route for packets to
travel down – an intermediate point in a journey.
 Switch: Often used interchangeably with router
but implies that the routes are “fixed”.
 Source: Where data is coming from.
 Destination: (or sink) Where data is going to.
A Simple Model of Reliable Internet
Communications.
 To send data to another computer:
 Find the address of the computer you are sending to.
 Break the data into manageable chunks (packets).
 Put the address on each packet (packet heard) and also
your own address.
 Send each packet in return to the receiving computer.
 Get a receipt for each packet which has been sent.
 Resend packets for which we do not have a receipt.
 The receiver then reassembles the packets to retrieve
the data sent.
Models of the Internet
OSI/ISO Reference Model
Application
Presentation
Session
Transport
Network
Data Link
Physical
TCP/IP Reference Model
Application
Model Layers
Open Systems Interconnection
(International Standards Office)
Transport
Internet
Host-to-network
Transmission Control
Protocol/
Internet Protocol
1) Physical layer
 Purpose: Necessary infrastructure.
 Think "wires in the ground and switches
connecting them".
 This is the physical hardware of the internet.
 Wires/optical cables/wireless links and other
technologies provide a way for transmission of
raw bits (0s and 1s).
 Routers and switches connect these cables and
direct the traffic.
2) Data link layer
 Purpose: Provides basic connection between two
logically connected machines.
 Think: “I stuff packets down a wire to my
neighbour”
 Send raw packets between hosts.
 Basic error checking for lost data.
 In TCP/IP the "Physical layer" and the "Data
Link" layer are grouped together and called the
host-to-network layer.
3) Network Layer/Internet Layer
 Purpose: Provide end-to-end communication
between any two machines.
 Think: “I try to get a packet to its destination”
 Tells data which link to travel down.
 Addresses the problem known as routing.
 Deals with the question "where do I go next to
get to my destination?"
 Ensures packets get from source A to destination
B.
4) Transport Layer
 Purpose: Ensure that data gets between A and B.
 Think: “From the source and destination, I make
sure that the data gets there”.
 Ensures a data gets between source and
destination.
 If necessary ensure that connection is lossless
(resend missing data).
 Provides flow control if necessary (send data
faster or slower depending on the network
conditions).
5) Session Layer (not TCP/IP)
 Purpose: Provides a single connection for one
application.
 Think: “I am in charge of the entire message.”
 This connection may be two way or may be
synchronised.
 Not discussed much as it is never implemented.
6) Presentation Layer (Not TCP/IP)
 Purpose: Provides commonly used functions for
applications.
 Think: “I meet internationalisation standards”.
 The main job of the presentation layer is to
ensure that character sets match – e.g. that
Chinese characters are correctly received by the
sends.
 Again not discussed much as it is never
implemented.
7) Application layer
 Purpose: The computer programs which actually do
things with the network.
 Think: “I deliver the mail, browse the web etc.”
 For example, your email client program which will talk
to the email server at the other end.
 At this layer, we have many protocols (http, snmp,
smtp, ftp, telnet) which different bits of software use.
 We often talk in terms of client and server architecture
for the software.
TCP/IP model in summary
Internet (IP) addresses
xxx.lcsee.wvu.edu (email, or similar)
http://www.apoptygma.eu.org (www)
ftp://ftp.uk.debian.org (file transfer)
telnet://towel.blinkenlights.nl (telnet)
157.182.194.89
These are the “real” IP addresses
148.122.211.110 of the above sites. IP addresses
are 32 bits grouped into 4 octets.
195.224.53.39
(Octet = 8 bits – a number from
62.250.7.101
0-255)
IP Networks(1)
 IP addresses use less significant bits first to
indicate sub-networks.
 IP address: 123.45.67.89
 Netmask:255.255.255.0 (no holes allowed)
 If two IP addresses are the same when bitwise
AND’d against the netmask then they are on the
same subnet.
 123.45.67.?? is always on the same subnet in the
above example.
The IP header
 IP packets all have a header as shown
About the IP header
 Type of Service: (Best efforts, immediate
delivery etc)
 Total length (of whole packet)
 Identification (number of packet for later
reassembly)
 Fragment offset – sometimes the network splits a
packet into fragments.
 Flags (information about fragments). DF= Dont
Fragment MF= More Fragments to come
About the IP header (2)
 Time To Live (TTL) – reduced by one every hop.
When it reaches zero packet is killed. (This is to
ensure that the network doesn’t fill up with lost
packets).
 Protocol – identified by a number (usually TCP
or UDP).
 Checksum – to ensure that the packet is not
corrupted.
IPv6
 IPv4 allows over 4 billion computers (but not really) –
inefficient subnetting is using these up.
 IPv6 allows 16 octet addresses (4 octets in IPv4).
 3x1038 addresses (> Avogadro’s number). 7x1023 IP
addresses per square meter of the earth’s surface.
 Why so many? Electrical devices may want IP addresses
– your house could be its own subnetwork. Why NOT?
 Better security than current IP(v4).
 Allow “roaming hosts”.
 Pay more attention to type of service (for real time data).