Gigabit Router의 패킷 처리 방법

고속 packet processing 기술
김종권
2017-07-31
 SNU INC Lab
Contents

Introduction



Router에의 QoS 기능 추가




Forwarding engine
현재의 IP 패킷 처리 방법
Packet filtering(classification)
Scheduling algorithms
Open problems
Summary
2017-07-31
 SNU INC Lab
Common Architecture
2017-07-31
 SNU INC Lab
FE의 기능

Input



Output




IP header
Inbound MAC header의 일부
MAC header info
Outbound interface
Outbound next hop
Performance


FE module의 성능 = 전체 system의 성능
Pipelining
 한 packet의 header를 처리하는 동안 다음 packet의 header
load
2017-07-31
 SNU INC Lab
FE 알고리즘


병렬화
문제점


Route lookup 후에만 TTL = 1/0인 packet을 폐기한다.
Route lookup 후에만 header를 갱신하다.
IP 전송의 세 부분
1. Error Check





Lengths
Version
Martians
Checksum
TTL
2017-07-31
2. Route Lookup


Cache
Full
3. Header Update




 SNU INC Lab
TTL
Checksum
Link Layer
header
Fragmentation
Router의 IP Packet 처리 방법

Packet 도착



Link 정보를 IP에 제공
Header 확인


Link-layer 주소와 의미가 일치하는 지 확인
Router를 위한 packet 결정


IP header checksum, version, header length 등 확인
주소 확인


Link level processing (CRC check 등)
Router를 위한 packet은 다르게 처리된다.
Router를 위한 packet의 목적지 주소
2017-07-31
 SNU INC Lab
Router의 구조
Fig. Integrated services architecture implemented in router
2017-07-31
 SNU INC Lab
Queueing Disciplines

Packet filtering(Classification)


Map each arriving packet into one of classes
Proposed algorithm (SIGCOMM ‘98)
 “Fast and Scalable Layer Four Switching”
 Washington University
 V. Srinivasan, G. Varghese, S. Suri, M. Waldvogel
 “High Speed Policy-based Packet Forwarding Using Efficient
Multi-dimensional Range Matching”
 Bell Labs
 T. V. Lakshman, D. Stiliadis

Scheduling


어떤 순서로 packet들을 서비스 할 것인가?
Desired link sharing 고려
2017-07-31
 SNU INC Lab
Wash Univ Algo (1/ 3)

Grid-of-tries

Two-dimensional filters
2017-07-31
 SNU INC Lab
Wash Univ Algo (2/ 3)

Cross-Producting


각 Field 별로 따로 검색하여,
cross-product table의 hash
table을 lookup
Memory explosion problem
2017-07-31
 SNU INC Lab
Wash Univ Algo (3/ 3)

Comparison

Grid-of-tries
 Destination-source prefix filter에만 적용 가능

On-demand cross-producting
 임의의 filter에 적용 가능
 Cache miss 때문에 speed를 예상하기 어렵다.

Grid-of-tries와 Cross-producting의 혼합

Grid-of-tries
 Destination-source filters

On-demand cross-producting
 나머지 filters
2017-07-31
 SNU INC Lab
Bell-Lab Algo (1/ 3)

Point location problem in multidimensional space


Preprocessing



Given a point in a d-dimensional space, and a set of n ddimensional objects,
각 dimension마다 생기는 interval을 계산한다.
각 interval을 포함하는 filter들을 계산한다.
Packet classification



Packet의 각 차원 별로 어느 interval에 속하는지 계산한다.
각 interval을 포함하는 filter들의 교집합을 구한다.
가장 우선 순위가 높은 filter를 사용한다.
2017-07-31
 SNU INC Lab
Bell-Lab Algo (2/ 3)

2-dimension인 경우의 예
0 0 1 0
Y6
0 1 1 0
Y5
1 1 1 1
Y4
1 0 1 1
Y3
1 0 0 1
Y2
1 0 0 0
Y1
3
2
P1
4
1
1 2 3 4
4
3
2
1
2017-07-31
X1
X2
X3
X4
X5
X6
1
0
0
0
1
1
0
0
1
1
0
1
1
0
1
1
1
0
1
0
1
0
0
0
 SNU INC Lab
Bell-Lab Algo (3/ 3)

Hardware Implementation




Integer comparator, counter
AND operation
n 번의 binary search
n 개의 값에 대한 AND 연산
2017-07-31
 SNU INC Lab
Scheduling

필요성
2017-07-31
 SNU INC Lab
Weighted Fair Queueing

특징



GPS simulation(Packet GPS)
Variable-size packets
Algorithm


GPS를 simulation하여 그 결과에 따라 service 순서 결정
Finish number
 GPS에서 packet의 finishing time
P( i , k ,t )
F ( i , k ,t )  max{ F ( i , k  1,t ), R( t )} 
( i )
2017-07-31
 SNU INC Lab
WFQ - Evaluation

Evaluation


GPS scheduling에 비해 maximum packet size 보다는 늦게
전송되지 않는다는 것을 보장
Isolation 보장
 최대 지연은 다른 connection의 behavior에 영향 받지 않는다.

Problem


Expensive and complex to implement
O(N)
2017-07-31
 SNU INC Lab
Virtual Clock

Real time 사용
P( i , k ,t )
F ( i , k ,t )  max{ F ( i , k  1,t ),real time} 
( i )

Time complexity



Virtual time 계산: O(1)
Sorting: O(log N)
단점

Unbounded unfairness
2017-07-31
 SNU INC Lab
Self-Clocked Fair Queueing

현재 서비스 중인 packet의 finish number를 system의
virtual time으로 사용.
P( i , k ,t )
F ( i , k ,t )  max{ F ( i , k  1,t ),CF} 
( i )

Time complexity



Virtual time 계산: O(1)
Sorting: O(log N)
단점


End-to-end delay bound  N
Unfair over short time scales
2017-07-31
 SNU INC Lab
Weighted Round-Robin

Weighted round-robin


Different weight
Different size
 Divide each connection’s weight by its mean packet size to
obtain a normalized set of weights.

단점

Source’s packet size may be unpredictable.
 Source cannot predict its mean packet size.

Fair only over time scales longer than a round time.
 If a connection has a small weight, or the number of
connections is large, this may lead to long periods of
unfairness.

Good in high speed network like ATM
2017-07-31
 SNU INC Lab
Deficit Round-Robin

DRR can handle variable packet size without
knowing the mean packet size.
Quantum size : 1000 byte
2000
1000
0
1500
A
800
B
1200

1st Round




C
2nd Round


Second
Round
2017-07-31
First
Round
Head of
Queue
 SNU INC Lab
A’s count : 1000
B’s count : 200 (served)
C’s count : 1000

A’s count : 500 (served)
B’s count : 0
C’s count : 800 (served)
Frame-based Fair Queueing



Potential function 사용
Re-calibration periodically
Fairness 보장


Bounded period system
potential update
Bounded discrepancy
2017-07-31
 SNU INC Lab
Leap Forward Virtual Clock

두개의 priority queue 사용
H: Priority Queue of Active
Well-behaved Flows
Transfer before
a packet can
miss its deadline.
Transfer when
a flow becomes
oversubscribed.
L: Holding Area for Active
Oversubscribed Flows
2017-07-31
Service Packet
with Lowest
tag in H
 SNU INC Lab
LFVC Implementation &
Evaluation

Implementation



van Emde Boas Data Structure 사용
O(loglog N)
Evaluation


Data Structure가 H/W로 구현하기에는 너무 복잡하다.
Worst case에는 L에서 H로 옮겨야 하는 packet이 N개일 수
있다.
2017-07-31
 SNU INC Lab
Discrete-rate Approach

Per-rate queueing for ATM


같은 rate를 갖는 session들을 하나로 묶어 macro-session
형성
Two-level hierarchical scheduler

First level: GPS-related scheduler
 각 macro-session의 output-link access 관리

Second level: Round-robin fashion
 각 session에 rate 분배
2017-07-31
 SNU INC Lab
H/W Implementation

Calendar queue 사용
2017-07-31
 SNU INC Lab
Core-Stateless Fair Queueing

Core-Stateless architecture


Edge nodes: do perform per flow management
Core nodes: do not perform per flow management
2017-07-31
 SNU INC Lab
CSFQ Algorithm

Edge router




Maintain per flow state
Estimate the incoming rate
Label the packet
r̂
Core router




Maintain no per flow state
FIFO packet scheduling with probabilistic dropping algorithm
̂
Drop each packet with prob. P(= max{0, 1
})
r̂
Update packet label to min{ r̂ ,̂ }
2017-07-31
 SNU INC Lab
Open Problems - by Keshav

Flow Identification


Resource Reservation


Configuration tools
Stability of Large Systems


Efficient flow classifiers, good policing
Ease of Configuration


Fast classification algorithm, efficient flow descriptors
Stability of router software
Accountability

Pricing
2017-07-31
 SNU INC Lab
Summary

Current research issues



Table lookup
QoS
Open problems
2017-07-31
 SNU INC Lab
References

“Fast and Scalable Layer Four Switching”, V.
Srinivasan, G. Varghese, S. Suri, M. Waldvogel, SIGCOMM’98.

“High Speed Policy-based Packet Forwarding Using
Efficient Multi-dimensional Range Matching”, T. V.
Lakshman, D. Stiliadis, SIGCOMM’98.

“Efficient Fair-Queueing Algorithms for PacketSwitched Networks”, D. Stiliadis, A. Varma, Trans. on Net.,
Apr. 1998.

“Hardware Implementation of Fair Queueing
Algorithms for Asynchronous Transfer Mode
Networks”, A. Varma, D. Stiliadis, IEEE Comm., Dec. 1997.
2017-07-31
 SNU INC Lab
References

“Leap Forward Virtual Clock: A New Fair Queuing
Scheme with Guaranteed Delays and Throughput Fairness”,
S. Suri, G. Varghese, G. Chandranmenon, INFOCOM’97.


“High Speed, Scalable, and Accurate Implementation
of Packet Fair Queueing Algorithms in ATM
Networks”, J. Bennett, D. Stephens, H. Zhang, ICNP’97.
“Implementing Fair Queueing in ATM Switches: The
Discrete-Rate Approach”, F. Chiussi, Andrea Francini,
INFOCOM’98.

“Core-Stateless Fair Queueing: Achieving Approximately
Fair Bandwidth Allocations in High Speed Networks”, I.
Stoica, S. Shenker, H. Zhang, SIGCOMM’98.
2017-07-31
 SNU INC Lab