networkscourses.cecs.anu.edu.au/courses/comp2310/lectures/networks.pdf · networks other matters:...

16
Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network performance and principles OSI protocol; routing TCP/IP layers and packet organization IP addresses and NAT firewalls IEEE 802 network standards example: Ethernet virtualization: overlay networks (diagrams from Coulouris et all Distributed Systems) COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ ◮ ◮◮ × 1

Upload: others

Post on 29-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Networks

Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!)

Ref: [Coulouris&al Ch 3, 4]

● network performance and principles

● OSI protocol; routing

● TCP/IP layers and packet organization

● IP addresses and NAT

● firewalls

● IEEE 802 network standards

● example: Ethernet

● virtualization: overlay networks

(diagrams from Coulouris et all Distributed Systems)

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 1

Page 2: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Network Performance ([Coulouris&al Fig 3.1])

&�

also at chip &

board level!

● latency: time for 1st byte of message to arrive

■ determined primarily through software overheads and routing delays

● data transfer rate: rate at which subsequent bytes arrive

■ determined primarily by network’s physical characteristic

● time to transmit message = latency + length × data transfer rate

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 2

Page 3: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Network Principles

● messages transmitted in packets of restricted length (MTU: max. transfer unit)

● switching schemes

■ broadcast■ circuit switching: series connection for whole message (c.f. old telephony)■ packet switching: packets individually routed to destination

● internetworks: communication in which several networks are linked together

● protocols: typically layered, to simplify software interfaces, hide heterogeneity

■ N layers requires N transfers of control and N copies (2×!)

,������������������

�����'����� ������&����!�

��������������

-���������������

���� �� �������

�����'�����

,�����������

�������

-��������

���� ��

2�������

,����'��

)����!������ )����!����'��*��

������ +�'������

(�����

��&&$��'�����

&���$&

[Coulouris&al Fig 3.3] encapsulation [Coulouris&al Fig 3.4]: layers in OSI model

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 3

Page 4: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Open Systems Interconnection Model Layers

[Coulouris&al Fig 3.5]

����� ������� �������

'���������� "���������(����� ������ �������(����������������)������������������������������������� ��������(����������������*���� �

+,,"�-," ��.,"��/0�'��/"

"����������� "�����������(����*���������� ���������1��&���������������(������ ���� ������(������������������� ���� �*� �������������1(��(��� ������������������������������ ���(������������)���� �

���������&���2��34��/0�'����0���

������� '��(����*��������������� � ������������������� ����(�� �������������������� �������������*����

,�������� ,(�����(���1�����*����1(��(��������2���(���(�����&���4���(�� �� �.����������� ����� �������������������������(� ������������"�����������(����������������������5������� �����������������

,�"�6�"

7��1��& ,�������� ������&������1��������������������������1��&����8'7

������������1��&�(����*��*���(���������������������������(����(�����������������3'7�������������)���� �

�"�',.*������

��������

�������& 0������������������������������&������1����� ���(����� ��������������� ����(���������&����8'7�����������������1����������������������1������������ (��������3'7�������1������������(�����

��(�����.'��',.�������������"""

"(������ ,(����������� (�� 1����(�� ��*��(����1��&��������������)�������������� ������������������������������������ ������)������� ��������������������������2���������������4����(��������2��������������������4����(������������������������2���� ���� �����1�*���������4�

��(���������5��� ����������� ���7

OSI loses out to TCP/IP (90’s)

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 4

Page 5: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Internetwork Layers and Transmission Issues

4��������!����� ��

�����'�����

���� �� ���������'�

-��������

"�������� ��

"�������� �� ���' ���

���� �� ���'�� �'���' ���

)����!�(�����

"�������� �� �����'���

4��������!���� �� �����'���

[Coulouris&al Fig 3.6] Internetwork layer

● a ‘virtual’ layer

● sub-layers are not clearly distinguished from

each other

Transmission Issues:

● network layer packets have a header and

data field

● transport addressing via an IP

address and a port number

● port numbers 0..1023 reserved

for services (server ‘daemons’

with root permissions)

● packet delivery:

■ (UDP) datagram: one-shot

delivery; networks retains

no info

■ virtual circuit: a route

involving all intervening

nodes is set up

■ any number of packets can

be (re-) transmitted; routed

via virtual circuit number

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 5

Page 6: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Routing

● routers are node s in the network (connected to several network links)

● routing is process of choosing links at each stage

■ achieved by looking up a routing table on the destination’s IP address

6����(�� �

�����'���

������ �

2 �

7

.�

3

+�$����

([Coulouris&al Fig 3.7]): routing in a wide area

network

���� ��������� ���� ���������

�� � � ���� �� � � ����

'

�����

%

%

9

%

$

%

#

%

#

'

%

�����

#

%

;

%

$

%

#

%

([Coulouris&al Fig 3.8]): routing tables for

nodes A and B

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 6

Page 7: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Example: Simplified View of a University Campus Network

����

'�&�$��

����$�

������

����

����� ��

�������������

�������������

������������������

��$���;� ����

�����������������������������

�������������

�������������������

��������

��9

����������������

���*��

��� ����'�&�$����� ����������

������

������

�����'�

���������

���*��

���*��

���*��

�������������

������!�������������

��� ����'�&�$�����

�����'�

���������

�$9�$9

"��!���������"��##������

��������*���

��$���;��������

�������������

�����)9�����������

�����'�����������������'�

����)9�����������

��������*��;!������

��������

��&�$���$���

��&�$���$���

����������

([Coulouris&al Fig 3.10])

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 7

Page 8: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Pseudo-code for RIP Routing Algorithm

Routers exchange information using the router information protocol

● send: each t seconds or when Tl changes, send Tl on each non-faulty outgoinglink

● receive: whenever a routing table Tr is received on link n:

for all rows Rr in Tr {

if (Rr.link != n) {

Rr. ost = Rr. ost + 1;

Rr.link = n;

if (Rr.destination is not in Tl) add Rr to Tl;

// add new destination to Tl

else for all rows Rl in Tl {

if (Rr.destination == Rl.destination &&

(Rr. ost < Rl. ost | | Rl.link == n)) Rl = Rr;

// Rr. ost < Rl. ost: remote node has better route

// Rl.link == n: remote node is more authoritative

}}

● enables network to be adaptive to arrival of new nodes, changing traffic conditionsetc

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 8

Page 9: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Routing and Congestion Control

● once a node reaches its capacity, its packet queues grow to its maximum length

■ has no option but to drop further traffic

■ this can cause re-transmission of dropped packets:

can result in devastating loss of network performance!

● rule of thumb: all nodes must keep within 80% of their capacity

● node only knows address of previous node in the route

■ it can request previous node to slow down rate of sending when near capacity

■ this can propagate back to original sender

● note: vulnerability of nodes to denial of service attacks!

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 9

Page 10: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

The Internet Protocol

)����!���042,1���������&��0-�,1

�����'�����

-��������

"�������

42,����-�,���' ���

",�����!��&�

������ ���'���'����&��

)����!�(�����

4��������!�������

������ ���������'�

([Coulouris&al Fig 3.12]) TCP/IP layers

IP protocol two main higher-level protocols:

● transport control protocol (TCP):

reliable, connection-oriented

● user datagram protocol (UDP):

unreliable, datagram-based

�����'������&����!�

-�,�������

",�������

���������������

������������&�

����

-�,

",

([Coulouris&al Fig 3.12]) encapsulation in a

TCP message

����",�����������������������",��������������$�'�

������

$�����3.� ���9����

([Coulouris&al Fig 3.17]) IP packet layout

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 10

Page 11: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Internet IP Addressing and Protocols5 �.

�������� � ���� �� �"2 6����"2

�. �3

������7� � � ���� �� �"2 6����"2

�� 8

�������� � � � ���� �� �"2 6����"2

�8

������2�0&$���'���1� � � � � )$���'�����������

�5

��������0�����*��1� � � � � $�$����

�8

([Coulouris&al Fig 3.15]) internet address

structure, showing field sizes in bits

�'����� �'����� �'�����

�������� �������5

�������� �������� �������.

������7� ��8�����:�

�������� �:���������

��.������:�������2�0&$���'���1�

������ �"2

������ �"2

������ �"2

6����"2

6����"2

6����"2

)$���'�����������

�������� �������� �������.

�������� �������� ��������

�������� �������� ��������

�������� �������� �������.�.�����������������0�����*��1�

�%�%�%�������5%���%���%���

��8%�%�%������:�%���%���%���

�:�%�%�%��������%���%���%���

��.%�%�%�������:%���%���%���

�.�%�%�%��������%���%���%���

+��!��������������

([Coulouris&al Fig 3.16]) decimal

representation of Internet addresses

● reliability: IP header has a checksum

● IP layer must also insert the physical address of message destination

● source address is also included but can be forged (‘spoofing’)

● note: packets can be received in any order; requires message to be assembled (at

TCP level)

● why we need cognitive protocols

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 11

Page 12: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

IP Addressing Issues and Solutions: NAT networks

● addressing scheme must be universal and efficient in its use of the space

■ the latter is not well achieved with IPv4!

■ solutions include IPv6 (128 bit addresses), address re-mapping schemes (e.g.

CIDR) and NAT

● Network Address Translation Protocol ([Coulouris&al Fig 3.18])

■ nodes inside NAT-enabled router use a privateIP addresses (e.g. 192.168.y.x)

■ when send a packet, router records source IPaddress & port number in its addresstranslation table

■ router replaces this with its own IP addressand a virtual port number

■ when router receives external packet with thisvirtual port number, it replaces this with theinternal node’s IP address and port number

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 12

Page 13: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Firewall Configurations ([Coulouris&al Fig 3.21])

"�������

+�$���;,����'������������

�1�#�������!���$���

"�������

91�#�������!���$��������9������

� �����

"�������

+;������'1��'��������$9��������9������ +;������ 7������

+;������ 7������

� �9;������*��

� �9;������*��

� �9;������*��

● provide control

on services,

behaviors and

users

● controlling

behaviors (e.g.

spam) may

require

examining

message

contents

● also ‘deep

packet analysis’

is used

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 13

Page 14: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

IEEE 802 Network Standards and the Ethernet

IEEE No. Name Title ([Coulouris&al Fig 3.22]) Reference802.3 Ethernet CSMA/CD Networks (Ethernet) [IEEE 1985a]802.4 Token Bus Networks [IEEE 1985b]802.5 Token Ring Networks [IEEE 1985c]802.6 Metropolitan Area Networks [IEEE 1994]802.11 WiFi Wireless Local Area Networks [IEEE 1999]802.15.1 Bluetooth Wireless Personal Area Networks [IEEE 2002]802.15.4 ZigBee Wireless Sensor Networks [IEEE 2003]802.16 WiMAX Wireless Metropolitan Area Networks [IEEE 2004a]

Ethernets: widely used for local area networks

● based on contention bus: single connection medium to all nodes

● nodes ignore messages which do not have their destination address

● requires collision detection: when 2 nodes try to use bus at same time

● protocol is called medium access control (MAC)

● packet (‘frame’) layout:bytes: 7 1 6 6 2 46..1500 4preamble S dest’n. source length data checksum

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 14

Page 15: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Virtual Networks - Overlay Architecture

([Coulouris&al Fig 4.16]) Skype overlay

architecture

Overlay networks are virtual network sitting

on top of an existing network offering

new/enhanced services

● e.g. multicasts, secure communication

● enables existing network layers to be

extensible

● e.g. Skype: peer-to-peer internet

telephony

■ super nodes (SN): hosts meeting

criteria, i.e. high bandwidth and

reachability

■ other users selects an SN; ≤ 8

SNs might get contacted for user

searches

■ TCP used for call requests; TCP

or UDP use for voice streaming

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 15

Page 16: Networkscourses.cecs.anu.edu.au/courses/COMP2310/lectures/Networks.pdf · Networks Other Matters: draft Assignment 2 up (Labs 7 & 8 v. important!!) Ref: [Coulouris&al Ch 3, 4] network

Summary

● network architecture is layered in a stack

■ headers for each level are appended as message moves down

● addressing is via IP number (to route message to destination machine) and a port

(direct message to destination application)

● TCP is connection-based (broken into packets) , reliable;

UDP is datagram-based (one shot); unreliable

● TCP/IP-v4 addresses structured into various type

running out of space ⇒ NAT (virtual port numbers), IPv6 schemes

● security is an increasing concern!

● networks are a whole subject of study on their own!

COMP2310 Lecture 23: Networks 2014 ◭◭ ◭ • ◮ ◮◮ × 16