the Internet は「ネットワーク」のネットワークであり、 各「ネットワーク」は Automomous System (自律システム) である。
RIP は UDP (520番port)で運ばれる (IP Header 20 byte, UDP Header 8byteがRIPパケットの前につく)。 1つのRIPに25経路まで含めることができる(4+20*25=504byte < 512byte)。 これ以上の経路を送る場合は、複数個の RIP を流すことになる。
[RIP format]
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 (32bits width)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Command | version | 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <-+
| Address Family (2) | 0 | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 32bit IP Address | |routing
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |infor-
| 0 | |mation
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |(20byte)
| 0 | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| metric (1-16) | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <-+
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <-+
| | |routing
| Routing Information (x24 Max) | |infor-
| | |mation
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <-+(20byte)
Command = 1(request), 2(reply), 3(unused), 4(unused), 5(poll), 6(poll entry)
version = 1 or 2 (通常1)
Address Family: IP Address は2
Metric: 1-15はホップ数。16は∞の意味。
[routedの動作]
p.148 Fig 10.4 ---------+------------------ N1 | R1 | ----+-----------+------------ N2 | R2 | -----+----------------- N3
![]()
(例) ある TARGET への経路の途中にある router R4 が落ちた場合 ---R1---R2---R3---R4---TARGET
ホスト sun から2台の router に対して、それぞれの routing table を 照会する。
p.149, p.150 sun% ripquery -n netb 504 bytes from netb (140.252.1.183): 140.252.1.0, metric 1 140.252.13.0, metric 1 ← slip接続なのでmetric=1となっている 244 bytes from netb (140.252.1.183): sun% ripquery -n gateway 504 bytes from netb (140.252.1.183): 140.252.1.0, metric 1 140.252.13.0, metric 2 244 bytes from netb (140.252.1.183):
![]()
p.149 Fig 10.5 | gateway | ----------+------------+------------ 140.252.1 | netb | sun | ----------+------------------------- 140.252.13
![]()
[RIP version 2 format]
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 (32bits width)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Command | version | Routing Daemon |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <-+
| Address Family (2) | Routing Tag | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 32bit IP Address | |routing
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |infor-
| 32bit Subnet Mask | |mation
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |(20byte)
| 32bit Next Hop IP Address | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| metric (1-16) | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <-+
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <-+
| | |routing
| Routing Information (x24 Max) | |infor-
| | |mation
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ <-+(20byte)
Command = 1(request), 2(reply), 3(unused), 4(unused), 5(poll), 6(poll entry)
version = 2
Routing Daemon: routing daemonのPID(複数のrouting daemonを使える)。
Address Family: IP Address は2
Metric: 1-15はホップ数。16は∞の意味。
[RIP version 2 認証]
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 (32bits width)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Command | version | Routing Daemon |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address Family (0xffff) | Routing Tag (2) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Authentication (16 byte) |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
[OSPFの利点]
BGPを用いるrouter同士では、 「ある Autonomous System のネットワークに到達するまでの 完全な経路情報(途中のrouter全部のリスト)」を交換する (TCPコネクションをはって、BGP routing table全体を交換する)。 Keep Aliveメッセージを定期的(通常30秒おき)に近隣に送信する ことで接続状態を調べる。
Autonomous System「自律システム」 (the InternetはAutomonous Systemの相互接続)
最長適合(複数のエントリにマッチした場合はnetmaskが長いものを採用する)。
(例)
[1]ヨーロッパ
194.0.0.4 - 195.255.255.255 の Class C Address を使う。
(上位7bitが同じ。194/7, つまり netmask 254.0.0.0)
[2]ヨーロッパのあるプロバイダ
194.0.16.0 - 194.0.31.255
(194.0.16/20, つまりnetmask 255.255.240.0)
194.0.22.1へのルーティングは[1]と[2]の両方にマッチするが、ネットマスクが
長い[2]を選ぶ。