Linux-based Implementation Of a Router (B.Sc Graduation project)

Download Report

Transcript Linux-based Implementation Of a Router (B.Sc Graduation project)

Cairo University Faculty of Engineering Electronics &Communication dpt.

4th year

Linux-based Implementation Of a Router

Supervisor:

Prof. Dr. Khaled Foad El-Sayed.

Submitted by:

Ashraf Kamal Rahoma Hazem Mohamed Sobhi Hassanein Hossam El-Sayed Abd Allah Tarek Amr Hamed Zein El-Abidin Mohamed WALI Apr-20 (B.Sc Graduation project)

1

Apr-20

Introduction to QoS: Motivation:

• Internet Protocol (IP).was designed to provide best-effort service.

VoIP • FTP

QoS Terminology and Parameters:

QOS: Quality of Service (QoS) implies the ability to differentiate traffic streams and to define a level of performance for those traffic streams across a network. When heavily utilized networks are carrying various types of traffic for different users, QoS is a mean of offering better service

2

Parameters

1. Latency the delay a flow experiences when passing through a device 2. Jitter the latency variations 3. loss probability bandwidth distribution and availability (throughput or goodput) Apr-20

3

IntServ vs. DiffServ

Apr-20 Data path:  Per-flow  classification Per-flow buffer management .  Per-flow scheduling Control path:  Install and maintain per-flow state for data and control planes.

4

RSVP Protocol

Apr-20

5

RSVP Protocol

Apr-20

6

RSVP Protocol

Apr-20

7

RSVP Protocol

Apr-20

8

IntServ vs. DiffServ

Each has its won points of strength And weakness Apr-20

9

DiffServ Architecture DiffServ Architectural Model Differentiated Services Domain

Apr-20

DS Boundary Nodes and Interior Nodes: DS Ingress Node and Egress Node: Differentiated Services Region: Traffic Classification and Conditioning: Classifiers: Traffic Profiles: Traffic Conditioners: 10

Meters: Markers: Shapers: Droppers: Location of Traffic Conditioners and MF Classifiers: Within the Source Domain: At the Boundary of a DS Domain: In non-DS-Capable Domains: In Interior DS Nodes:

Apr-20

11

ToS VS DSCP Introduction Type of service byte definition

Apr-20

12

Type of service byte definition

Apr-20

13

Apr-20

Bits (0-2)

111 110 101 100 011 101 001 000

Table 2.1:

IP precedence bits

IP-precedence definition

Network control Internetwork control CRITIC/ECP Flash override Flash Immediate Priority routine

Table 2.2:

ToS field values Bits (3-6) 1000 0100 0010 0001 0000 ToS field definition Minimize delay Maximize throughput Maximize reliability Minimize monetary cost Normal service

14

Disadvantages of ToS

•The IP-precedence scheme allows only specification of relative priority of a packet. it has no provisions to specify different drop precedence for packets of a certain priority.

•The 3 bits restrict the number of possible priority classes to 8 •The ToS mechanism is not powerful enough to allow an application to quantify the level of service it desires.

Apr-20

15

Differentiated services field definition

Apr-20

16

Per Hop Behavior PHB

A per-hop behavior (PHB) is a description of the externally observable forwarding behavior of a DS node applied to a particular DS behavior aggregate (BA).

Different PHB’s Currently there are 4 standard different per hop behaviors PHB’s:

Default PHB Class-Selector PHB.

Assured Forwarding (AFny) PHB.

Expedited Forwarding (EF) PHB.

Apr-20

17

Apr-20

Name

Default PHB

Class-selector PHBs ’xxx000’ DSCP

000000 111000 110000 101000 100000 011000 101000 001000

Expedited Forwarding EF

101110

Assured Forwarding AF

AF1y 001 AF2y 010 AF3y 011 AF4y 100 010 100 110 010 100 110 010 100 110 010 100 110 0x28h 0x30h 0x38h 0x48h 0x50h 0x58h 0x68h 0x70h 0x78h 0x88h 0x90h 0x98h

18 (Hex)

0x0h 0x38h 0x30h 0x28h 0x20h 0x18h 0x28h 0x8h 0xB8h

Description Best Effort (BE)

Network Control Inter-netwrok Control CRITIC/ECP Flash override Flash Immediate Priority Low-loss, low-jitter bandwidth low-latency, and assured Low dP medium dP high dP low dP medium dP high dP low dP medium dP high dP low dP medium dP high dP

DiffServ Support under Linux

Linux Traffic Control Overview

Apr-20

19

Apr-20

Linux Traffic Controller

Syntax: tc [OPTIONS] OBJECT {COMMAND | help} Where OBJECT: = {qdisc | class | filter}

OPTIONS: = {-s [tatistics] | -d [etails] | -r [aw]} Queueing disciplines 1.

DSMARK 2.

CBQ 3.

TBF 4.

p/bFIFO 5.

PRIO 6.

RED 7.

GRED 8.

Ingress

Classes 1.

DSMARK 2.

CBQ

filters (or classifier)

1.

U32 2.

TCINDEX 3.

ROUTE 4.

FIREWALL Police 20

Implementation and Code

TC Implementation

Apr-20

21

Note: In this drawing only one AF class is shown for the simplicity of the drawing, the other ones are just the same.

DSMARK CBQ

pFIFO: Low queuing delay (latency). Well defined minimum departure rate, i.e. independent of the other traffic at the node. No burst. (policing).

4 CBQ: Apr-20 Four AF classes with different fractions of the bandwidth allocated for each. In each one we have three dropping precedence’s (RED) Bandwidth assurance,

RED:

No bandwidth guarantee. No quality of service: No policing filters, no shaping.

22

Apr-20

Traffic Classes

Variables: Setting Functions: Constructor.

Destructor Set Device Set Network Set Rates Set PHB’s Set Police Set ToS 23

Infra-structure Functions:

t_reset( ) t_start( ) Apr-20 make_marker( ) make_BE( ) make_Subfilter( ) Make_phb( ) make_EF( ) make_AF( )

Filtering Functions:

Make Filter Get Command 24

Software implementation

Architecture Overview. Graphical User Interface (GUI). System programming. Apr-20

25

Architecture Overview

using C++ Classes To ensure encapsulation & independence To control the communication & error tracing To give the ability to change or update any specific parts.

Apr-20

26

Architecture Overview

using C++ Classes Apr-20

27

Detailed view

Apr-20

28

Apr-20

Communication between Classes

DiffServ Class A pp ly _advanced() Set_phb () Set_ polici ng() Apply_phb() Set_device() Set_network() Set_Rates() Apply_advanced() Apply_filter() Set_phb() Set_policing() Set_tos() make_filter() Traffic Class A pp ly _advanced() Set_phb () Set_ polici ng()

29

GUI tabs PHB configuration tab

Apr-20

30

Advanced PHB

Apr-20

31

Filter Setup Tab

Apr-20

32

Summary view Tab

Apr-20

33

TC Experts Tab

Apr-20

34

4.4 Testing:

Description

PC1 DiffServ Router

Platform Speed Running s/w

Linux Traffic Generator ( TG)

Ethernet cards

eth0 Linux DiffServ S/W eth0 eth1 Apr-20

35

PC2 Windows XP Traffic Monitoring (CommView) eth0

Apr-20

4.5 Testing procedure

We have performed testing on 3 basic levels: 1. Marking: Testing if packets were marked according to specified classification.

2. ToS: Testing if the classification according to ToS and monitoring packets flow were mapped to the required PHB 3. PHB’s Implementation: Monitoring different rates assigned to each class

36

Apr-20 Than You !

37