42
LSVE: A Network Primer Manuel Oliveira Manuel Oliveira Computer Science Department Computer Science Department University College London University College London

LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Embed Size (px)

Citation preview

Page 1: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

LSVE: A Network PrimerLSVE: A Network Primer

Manuel OliveiraManuel OliveiraComputer Science DepartmentComputer Science Department

University College LondonUniversity College London

Page 2: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Audience AssessmentAudience Assessment

• Know about networks?Know about networks?

• Know what TCP, UDP, multicast is?Know what TCP, UDP, multicast is?

• Know how a router works inside?Know how a router works inside?

• Know about multicast routing algorithms?Know about multicast routing algorithms?

Page 3: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

ContentsContents

• MotivationMotivation

• How to Talk to Network People?How to Talk to Network People?

• Network ElementsNetwork Elements

• Network Properties Network Properties

• Protocols Protocols

• Multicast Multicast

• How to Access the NetworkHow to Access the Network

• DiscussionDiscussion

Page 4: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Motivation: ApplicationsMotivation: Applications

• Remote TrainingRemote Training

• Combat SimulationCombat Simulation

• GamesGames

• EducationEducation

• VisualizationVisualization

• CollaborationCollaboration

• Socialization Socialization

Page 5: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Motivation: EvolutionMotivation: Evolution

MUDs

GraphicalMUDs

OnlineGames

VE

MATRIX

Presence

Evolution

Page 6: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Motivation: Games?Motivation: Games?

Page 7: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Motivation: Games PerspectiveMotivation: Games Perspective

• Humans are Social BeingsHumans are Social Beings• CollaborationCollaboration• Share ExperiencesShare Experiences

• UO most popular activity?

• CompetitionCompetition• Online categories: achievers, explorers, socializers and

killers

• A Human is better than AI/ALA Human is better than AI/AL

Page 8: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Motivation: Games Better than VE?Motivation: Games Better than VE?

Games VE*

Big budgets2-3 years cycleContent drivenEntertainment

RobustCool graphics

Network is not cool

Budget?PhD, masters or undergraduate

Functionality drivenTest research ideas

HacksCool slow graphicsNetwork less bad

* DIS systems are an exception

Page 9: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Talk to Network People: OSI ModelHow to Talk to Network People: OSI Model

Layer n+1

Layer n

Host A

Network

Layer n+1

Layer n

Host B

protocol

API

Page 10: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Talk to Network People: OSI ModelHow to Talk to Network People: OSI Model

Layer n+1

Layer n

Host A

Data

PDU n+1 Data

PDU n+1 DataPDU n

Page 11: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Talk to Network People: OSIHow to Talk to Network People: OSI

Physical

Data Link

Network

Transport

Session

Presentation

Application

How to Talk to Network People: OSI ModelHow to Talk to Network People: OSI Model

Page 12: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Talk to Network People: OSIHow to Talk to Network People: OSI

Physical

Data Link

Network

Transport

Session

Presentation

Application

Physical

Data Link

Network

Transport

Session

Presentation

Application

How to Talk to Network People: OSI ModelHow to Talk to Network People: OSI Model

Page 13: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Data Link

How to Talk to Network People: OSI vs IPHow to Talk to Network People: OSI vs IP

Internet Protocol

Transport

Application

Physical

Data Link

Network

Transport

Session

Presentation

Application

OS

Page 14: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Data Link

How to Talk to Network People: IPHow to Talk to Network People: IP

Internet Protocol

Transport

Application

TCP UDP

IPICMP

IGMP

ARP/RARPSNAPEthernet, FDDI

FTP SMTP DNS SNMP

Page 15: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Network Elements: OverviewNetwork Elements: Overview

• AddressAddress• HostHost

• User’s computer has unique IP address

• RouterRouter• Routes the data packets across the network

• Queues per link for incoming packets

• Lookup table

• GatewayGateway• Router that does protocol conversion

Page 16: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

• Class A Class A (network ID = 7 bits)(network ID = 7 bits)

• Class B Class B (network ID = 14 bits)(network ID = 14 bits)

• Class C Class C (network ID = 21 bits)(network ID = 21 bits)

• Class D Class D (multicast)(multicast)

• Class E Class E (reserved for future use)(reserved for future use)

Network Elements: Address + PortNetwork Elements: Address + Port

0 Network ID Host ID

1 Network ID Host ID

1 Host ID

1 Multicast group

1 reserved

1 1 0

1 0 Network ID

0

1 1 1 0

Page 17: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Network Elements: IP PacketNetwork Elements: IP Packet

Version Hdr len Type Of Service Packet Len

Identification Flags Fragment Offset

TTL Protocol ID Hdr Cheksum

Source address

Destination address

Options (if any)

Data

20 bytes

Page 18: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Network Elements: IP RoutingNetwork Elements: IP Routing

UDP TCP

ICMP

RoutingTable

Next Hop?

Local?

Options

Queue

Other

Network Interface

Admin commands

yn

src routing

routingredirects

Page 19: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Network PropertiesNetwork Properties

• Latency (Round Trip Time)Latency (Round Trip Time)

• JitterJitter

• Bandwidth (Capacity)Bandwidth (Capacity)

• Loss (Congestion, Reliability)Loss (Congestion, Reliability)

Page 20: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

ProtocolsProtocols

Transport Level:Transport Level:• User Datagram Protocol (UDP)

• Transport Control Protocol (TCP)

• ApplicationApplication• Real Time Protocol (RTP)

• Network Time Protocol (NTP)

• File Transfer Protocol (FTP)

• Domain Name Service (DNS)

Page 21: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Protocols: UDPProtocols: UDP

• ConnectionlessConnectionless• No state is maintained

• No setup time

• Light-weight

• No Quality of ServiceNo Quality of Service• No guarantee delivery

• No order delivery

Postal ServicePostal Service

Page 22: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Protocols: UDP packetProtocols: UDP packet

Source Port Destination Port

Length Hdr Cheksum

Data

8 bytes

Page 23: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Protocols: TCPProtocols: TCP

• Connection OrientedConnection Oriented• State is maintained at routers

• Setup Handshake

• Heavy-weight

• Quality of ServiceQuality of Service• FIFO delivery

• Flow Control

• Error Recovery

• MechanismsMechanisms• Sliding Window, Timers, Acknowledgements

Telephone ServiceTelephone Service

Page 24: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Protocols: TCP Peek under the HoodProtocols: TCP Peek under the Hood

Host A Host B

TimerPacket N

Ack N

Page 25: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Protocols: TCP Peek under the HoodProtocols: TCP Peek under the Hood

Host A Host B

Timer

Ack N

Packet N

TimerPacket N

Page 26: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Protocols: TCP packetProtocols: TCP packet

Source port Destination port

Sequence number

Ack number

Window size

Urgent Pointer

Options (if any)

Data

20 bytes

Checksum

FlagsHdr len Options

Page 27: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: OverviewMulticast: Overview

WAN

UnicastWAN

BroadcastWAN

Multicast

Page 28: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: ModelMulticast: Model

• UDP class D address – No physical meaningUDP class D address – No physical meaning

• Multicast is free on LANsMulticast is free on LANs

• An address defines a logical groupAn address defines a logical group

• A sender is oblivious to receiversA sender is oblivious to receivers

• Join/Leave operationsJoin/Leave operations

• Tree Based RoutingTree Based Routing

Page 29: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: Routing OverviewMulticast: Routing Overview

Multicast Routing Protocol

Internet GroupManagement Protocol (IGMP)

Page 30: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: RoutingMulticast: Routing

• Three types:Three types:• Flood/Prune (or Reverse Path Multicast) – basis for MBone

• Steiner - never implemented, just simulated

• Centred Based – begins to be deployed

• Some Protocols:Some Protocols:• Distance Vector Router Multicast Protocol (DVRMP)

• Multicast Open Shortest Path First (MOSPF) – based on link info

• Core Based Trees (CBT)

• Protocol Independent Multicast (PIM)

• Sparse Mode (SM), Dense Mode (DM)

Page 31: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: Core Based TreesMulticast: Core Based Trees

IGMP

CBT

join

join

join

Page 32: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: Core Based TreesMulticast: Core Based Trees

IGMP

CBT

join-ack

join-ack join

join

Page 33: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: Core Based TreesMulticast: Core Based Trees

IGMP

CBT

join-ack

Page 34: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: Core Based TreesMulticast: Core Based Trees

IGMP

CBT

Page 35: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: ProblemsMulticast: Problems

• Deployment problemsDeployment problems• mainly interdomain routing

• No pricing model

• Membership Authorisation

• Security

• Address Allocation:Address Allocation:• Scope

• Clashes

• Announce/Listen (sdr)

• TCP-Friendliness (congestion)TCP-Friendliness (congestion)• Error Recovery is a nightmareError Recovery is a nightmare

Page 36: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

Multicast: Temporary SolutionMulticast: Temporary Solution

• Single Source Multicast (SSM)Single Source Multicast (SSM)

• IGMPv3 – who to listen toIGMPv3 – who to listen to

• Multicast Source Discovery Protocol (MSDP) – RP exchangeMulticast Source Discovery Protocol (MSDP) – RP exchange

• Multicast Address Dynamic Client Allocation Protocol Multicast Address Dynamic Client Allocation Protocol (MADCAP) – Multicast DHCP(MADCAP) – Multicast DHCP

Page 37: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Access Network: CHow to Access Network: C

• Creating a SocketCreating a Socketint sock;

if ((sock = socket (PF_INET, SOCK_STREAM, 0))<0) {

do error handling

return

}

Protocol Family Socket Type

Protocol0 = default

Page 38: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Access Network: CHow to Access Network: C

• TCP - ServerTCP - Serverstruct sockaddr_in auxAddr;

bzero((char *)&auxAddr, sizeof(auxAddr));

auxAddr.sin_family = PF_INET;

auxAddr.sin_addr.s_addr = htonl(INADDR_ANY);

auxAddr.sin_port = htons(800);

If (bind(sock, (struct sockaddr *)&auxAddr, sizeof(auxAddr)) == -1) {

do error handling

return;

}

Page 39: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Access Network: CHow to Access Network: C

• TCP - ServerTCP - Serverstruct sockaddr_in clientAddr;

int clientSock;

listen(sock, 20);

while (clientSock = accept(sock, (struct sockaddr *)& clientAddr, sizeof(clientAddr)) != -1) {

process the clientSock, use threads!

}

do error handling

Page 40: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Access Network: CHow to Access Network: C

• TCP – ClientTCP – Clientstruct sockaddr_in auxAddr;

bzero((char *)&auxAddr, sizeof(auxAddr));

auxAddr.sin_family = PF_INET;

auxAddr.sin_addr.s_addr = inet_addr(“137.158.128.5”);

auxAddr.sin_port = htons(800);

if (connect(sock, (struct sockaddr *)&auxAddr, sizeof(auxAddr)) == -1) {

do error handling

}

Page 41: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

How to Access Network: CHow to Access Network: C

• TCP – ClientTCP – Client• int write(int /*socket*/,

byte * /*data*/,

int /*data len*/)

• int read(int /*socket*/,

byte * /*buffer*/,

int /*max to read*/)

Page 42: LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London

DiscussionDiscussion