View Full Version : OSPF củng cố kiến thức lại nào.
phamminhtuan
08-11-2008, 05:52 PM
Distance vector và link state
Khi ta học về giao thức distance vector thì router học đường đi nhờ neighbors [định tuyến theo tin đồn, neighbors bảo gì nghe nấy như RIP]. Giao thức distance chỉ tin cậy thông tin route của neighbor.
Học qua EIGRP thì có tiến bộ hơn tí là nó nghe tin đồn nhưng nó còn xác nhận lại để xem có đúng hay không [ở đây là xem đường nào tốt hơn]. EIGRP thì nhanh hơn nhưng chỉ hỗ trợ sản phẩm cisco.
Có một giao thức khác khá hơn 2 cái kia nhưng hơi tốn performance một chút, hỗ trợ đa chủng loại sản phẩm là OSPF. OSPF thì không nghe tin đồn như những giao thức kia mà nó lấy toàn bộ thông tin về state [trạng thái: links của router đó, interfaces, những neighbor của router đó, và trạng thái up/down,ip, subnet,…] của thằng gốc copy vào link state database của nó rồi tự tìm ra đường đi tốt nhất cho mình bằng thuật toán shortest-path-frist [hay còn gọi là Dijkstra].
Những con biên [ABR: area border router] nằm giữa nhiều biên có bản topology cho nhiều vùng khác nhau. Nó chỉ gửi tuyến route summary từ area khác ra cho area0 [backbone].
Nhưng trước khi trao đổi thông tin thì nó cần phải thiết lập một mối qua hệ gọi là neighbor. Quan hệ neighbor sẽ được thiết lập nhờ vào gói những gói hellos.
Khi router nhận gói hello từ neighbor thì nó kiểm tra:
Area ID
Authentication
Networkmask [subnet mask phải giống nhau]
HelloInterval, DeadInterval timer [trong môi trường broadcast là hello 10’, và Nonbroadcast là 40’. DeadInterval gấp 4 lần hello]. Sau thời gian dead mà không nhận được hello thì bỏ neighbors.
Cờ stub
Và một số option cấu hình trên interface nhận vào gói hello.
Khi trở thành neighbor thì các router có thể trao đổi các gói update cho nhau. Nhưng nếu như vậy thì sẽ tốn một lượng băng thông rất lớn vì một con sẽ cần trao đổi với tất cả các con còn lại.
=> Có n(n-1)/2 các quan hệ gần [adjacencies] với nhau.
Vì vậy cần tồn tại một quá trình để bầu chọn con chính [DR], chỉ có con chính là quan hệ được với các con khác, và một con phụ là BDR để backup con chính khi nó chết.
http://img291.imageshack.us/img291/633/83155119nx8.png (http://img291.imageshack.us/my.php?image=83155119nx8.png)
http://img291.imageshack.us/img291/83155119nx8.png/1/w605.png (http://g.imageshack.us/img291/83155119nx8.png/1/)
Quá trình bầu chọn DR, BDR có thể xảy ra trên môi trường Broadcast và NBMA networks.
Quá trình hình thành full adjacency có thể diễn ra qua 7 quá trình cơ bản sau.
Có 2 router A và B với Router ID tương ứng là a và b.
1.Down state
Hai router mới gắn vào và cấu hình thì ở trạng thài Down state
[router không nhận được thông tin từ router cận kề]
2. Init State
Chỉ có 1 router gửi gói tin hello và router kia nhận được nhưng chưa biết router ID của chính nó nên chỉ là 1 chiều. [one way]
3. Two-way state
1 router gửi có router ID của nó, router kia nhận được và hồi đáp lại với router ID của nó. Ở trong trạng thái này nếu ở môi trường Ethernet [hay còn gọi là multiaccess, hoặc broadcast] cũng bầu chọn luôn DR và BDR.
**Router có ưu tiên lớn nhất là DR, lớn nhì là BDR.
Ưu tiên theo thứ tự sau:
cấu hình priority [ip ospf priority]
cấu hình router ID bằng lệnh [router ID]
Loopback có IP cao nhất
interface vật lí có IP cao nhất
Router có priotity là 0 thì không tham gia vào quá trình bầu chọn DR/BDR.
:54:
phamminhtuan
08-11-2008, 05:54 PM
Nhưng trước khi làm tiếp thì mình hỏi mấy bạn thử DR sẽ được bầu trước hay BDR được bầu trước trong quá trình Two-way state? Các bạn trao đổi rồi bữa sau mình post trả lời.
longphi11
08-11-2008, 10:33 PM
sao so sai` the bac'
phamminhtuan
08-11-2008, 10:34 PM
Trời thì từ từ chứ, mấy bạn làm xong câu kia đi tui post tiếp chi tiết hơn. Vì OSPF nhiều lắm chứ đâu ít.
duanvcd
11-11-2008, 03:12 PM
Những con biên [ABR: area border router] nằm giữa nhiều biên có bản topology cho nhiều vùng khác nhau. Nó chỉ gửi tuyến route summary từ area khác ra cho area0 [backbone]
Router biên khuyến cáo là chỉ nằm giữa 2 vùng thôi==> 2 topology riêng biệt cho từng Area, route summary trên OSPF cũng khác với EIGRP: OSPF chỉ summary ở biên, trong khi EIGRP có thể summary ở bất kỳ node nào.
Một điều nữa là ko hoàn toàn việc bình chọn DR, BDR như ở trên. Vì nếu ko thực hiện đồng bộ việc cấu hình OSPF trên các Router thì router nào bật OSPF lên trước nghiễm nhiên nó là DR (!!!!).
Còn trả lời câu hỏi của bạn:
Theo mình thì OSPF phải chọn DR trước. Do BDR chẳng qua là con backup cho DR khi DR gặp sự cố thôi, hơn nữa khi so sánh độ ưu tiên, nó phải biết cái nào tốt nhất rồi mới biết cái tốt nhì chứ nhỉ??? :))
phamminhtuan
11-11-2008, 03:48 PM
Ok. Tui cám ơn ý kiến của ông, nhưng trường hợp tui nói là bình thường. Ông thử nối 2 area khác không vào nhau thì cần phải thêm cái virtual link.
Vd: R1--area0---R2---area1---R2--area1--R3---area2---R4
Còn con nào bật lên trước thì sẽ là DR, vì cho một ví dụ cụ thể là mạng cha và mạng con nối ở các chi nhánh khác nhau. Mạng cha đang làm DR, không lẽ mạng con cắm một router nào đó hoặc thay đổi RouterID chi nhánh của mình thì nó chi nhánh đó sẽ thành DR sao.
phamminhtuan
11-11-2008, 03:52 PM
Còn câu hỏi của tui thì đây là đáp án.
1.Tất cả các router tự xem nó là DR và BDR của mạng đó [thỏa dk priority > 0 và twoway]
2.Vì DR sẽ không thể là BDR được nên lựa ra những con nào không yêu cầu nó là DR [trong cùng subnet]
3.Nếu có một hoặc nhiều neighbor trong subnet mà có interface chúng nằm trong trường BDR, con có priority cao nhất sẽ được bầu.
Nếu bị trùng priority thì xét tiếp đến router ID cao nhất sẽ là BDR.
4
Nếu không có một hoặc nhiều neighbor trong subnet đó đòi làm BDR, con có priority cao nhất sẽ được bầu.
Nếu bị trùng priority thì xét tiếp đến router ID cao nhất.
5.Nếu có một hoặc nhiều neighbor trong sub mà có int chúng nằm trong trường DR, con có priority cao nhất sẽ được bầu.
Nếu bị trùng priority thì xét tiếp đến router ID cao nhất sẽ là DR.
6.
Nếu không có router nào là DR thì còn BDR được chọn gần đây nhất sẽ là DR [nguyên đám hồi nãy đã nằm hết trong subnet bầu chọn BDR nên bước 4 bầu chọn DR sẽ không thể có được]
Kế tiếp nó lại lặp lại bước 1 đến bước 2 đến bước 4 để chọn lại tiếp BDR.
The election procedure of the DR and BDR is as follows:
1.
After two-way communication has been established with one or more neighbors, examine the Priority, DR, and BDR fields of each neighbor's Hello. List all routers eligible for election (that is, routers with priority greater than 0 and whose neighbor state is at least two-way); all routers declaring themselves to be the DR (their own interface address is in the DR field of the Hello packet); and all routers declaring themselves to be the BDR (their own interface address is in the BDR field of the Hello packet). The calculating router will include itself on this list unless it is ineligible.
2.
From the list of eligible routers, create a subset of all routers not claiming to be the DR (routers declaring themselves to be the DR cannot be elected BDR).
3.
If one or more neighbors in this subset include its own interface address in the BDR field, the neighbor with the highest priority will be declared the BDR. In a tie, the neighbor with the highest Router ID will be chosen.
4.
If no router in the subset claims to be the BDR, the neighbor with the highest priority will become the BDR. In a tie, the neighbor with the highest Router ID will be chosen.
5.
If one or more of the eligible routers include their own address in the DR field, the neighbor with the highest priority will be declared the DR. In a tie, the neighbor with the highest Router ID will be chosen.
6.
If no router has declared itself the DR, the newly elected BDR will become the DR.
7.
If the router performing the calculation is the newly elected DR or BDR, or if it is no longer the DR or BDR, repeat steps 2 through 6.
In simpler language, when an OSPF router becomes active and discovers its neighbors, it checks for an active DR and BDR. If a DR and BDR exist, the router accepts them. If there is no BDR, an election is held in which the router with the highest priority becomes the BDR. If more than one router has the same priority, the one with the numerically highest Router ID wins. If there is no active DR, the BDR is promoted to DR and a new election is held for the BDR.
Còn để kiểm nghiệm thì để mai tui lại post lệnh debug cho.
duanvcd
11-11-2008, 04:16 PM
nối 2 area khác không vào nhau
Mình mới học single are thôi :D
Còn con nào bật lên trước thì sẽ là DR, vì cho một ví dụ cụ thể là mạng cha và mạng con nối ở các chi nhánh khác nhau. Mạng cha đang làm DR, không lẽ mạng con cắm một router nào đó hoặc thay đổi RouterID chi nhánh của mình thì nó chi nhánh đó sẽ thành DR sao.
OSPF là giao thức không chiếm quyền. Tức là 1 router đã là DR thì 1 router khác mới cài đặt vào dù RouterID của nó cao hơn vẫn chỉ là router bình thường (DROTHERS)
1.Tất cả các router tự xem nó là DR và BDR của mạng đó [thỏa dk priority > 0 và twoway]
Theo mình nghĩ cái này xảy ra khi mạng chưa có DR và BDR thôi. Khi đó mỗi con Router tự cho nó là DR với ID của nó. Sau khi so sánh ID với các Router khác qua gói Hello LSA thì mới quyết định được Router nào là DR, chứ có DR rồi thì bầu chọn làm chi??
phamminhtuan
11-11-2008, 04:43 PM
Uh thì ở trên tui cũng có ý là nó không thể chiếm quyền khi đã có DR ngoại trừ khi reboot lại, hoặc bằng lệnh "clear ip ospf process" [mà lệnh này ít khí ảnh hưởng được lắm trừ khi con muốn chiếm quyền và con DR cùng làm lệnh này]
Còn ở trên là khi không có DR và BDR thì nó mới bầu, tui hết sức tán thành với ông.
zai911
12-11-2008, 06:32 AM
Cai ong post chi noi len duoc trat tu qua trinh bau chon DR va BDR thoi. Chua giai thich cu the lam nhung cai thuan loi trong viec tai sao lai bau BDR truoc DR.
phamminhtuan
12-11-2008, 01:21 PM
Lệnh để xem DR hay BDR được bầu chọn trước và quá trình thiết lập neighbors thì ta có thể dùng lệnh "debug ip ospf adj"
phamminhtuan
12-11-2008, 01:26 PM
Cai ong post chi noi len duoc trat tu qua trinh bau chon DR va BDR thoi. Chua giai thich cu the lam nhung cai thuan loi trong viec tai sao lai bau BDR truoc DR.
Cái này giống như bầu tổng thống ấy. Thí dụ Tổng thống chính và phụ dead, thì phải bầu Tổng thống mới.
Trong lúc đang bầu tổng thống mới thì tổng thống chính bỗng dưng sống dậy.
Vậy đã bầu chọn tổng thống chính [người mới]rồi thì sao đây => bầu ông phụ trước đi. @-)
phamminhtuan
16-11-2008, 08:34 PM
Tiếp về phần thiết lập neighbor của OSPF
Quá trình bầu chọn DR, BDR có thể xảy ra trên môi trường Broadcast và NBMA networks.
Quá trình hình thành full adjacency có thể diễn ra qua 7 quá trình cơ bản sau.
Có 2 router A và B với Router ID tương ứng là a và b.
1.Down state
Hai router mới gắn vào và cấu hình thì ở trạng thài Down state
[router không nhận được thông tin từ router cận kề]
2. Init State
Chỉ có 1 router gửi gói tin hello và router kia nhận được nhưng chưa biết router ID của chính nó nên chỉ là 1 chiều. [one way]
3. Two-way state
1 router gửi có router ID của nó, router kia nhận được và hồi đáp lại với router ID của nó. Ở trong trạng thái này nếu ở môi trường Ethernet [hay còn gọi là multiaccess, hoặc broadcast] cũng bầu chọn luôn DR và BDR.
4. Exstart State
Nếu không có DR/BDR thì biết con nào sẽ gửi data trước. Quá trình này sẽ thương lượng xem con nào có Router ID cao hơn sẽ trao đổi trước.
5. Exchange State
Gửi bản tóm tắt về thông tin của nhau giữa những router. Nếu có DR thì chỉ gửi cho DR, sau đó DR sẽ trao đổi tiếp cho mấy con router khác.
[summary of LSDB]
Sau khi nhận thông tin tóm tắt xong mỗi router đều gửi LSACK để cho đối phương biết là mình đã nhận hoàn tất. Nếu không nhận LSA thì nó sẽ gửi lại.
6. Loading State
Nếu con nào cần đầy đủ thông tin về network nào đó thì nó sẽ gửi [DR hoặc router khác tùy thuộc vào môi trường ] để yêu cầu toàn bộ thông tin về network đó.
7. Full State
Khi đã nhận đầy đủ thì nó sẽ gửi LSACK để cho con kia biết nó nhận đầy đủ thông tin.
phamminhtuan
16-11-2008, 08:56 PM
Các loại môi trường trong OSPF
OSPS media types: Có 4 dạng
I. Multicaccess [đa truy cập]
Môi trường như Ethernet, Fast Ethernet, Gigabit Ethernet, FDDI. Mạng broadcast, OSPF sẽ tiến hành bầu chọn DR, BDR để giảm thiểu lưu lượng trên đoạn mạng.
http://img99.imageshack.us/img99/551/18591833fv5.jpg (http://img99.imageshack.us/my.php?image=18591833fv5.jpg)
http://img99.imageshack.us/img99/18591833fv5.jpg/1/w152.png (http://g.imageshack.us/img99/18591833fv5.jpg/1/)
II. Point-to-Point [điểm-điểm]
Là môi trường truyền dẫn được đóng gói HDLC/PPP, Framrelay/ATM point-to-point subinterface. Không có sự bầu chọn DR/BDR và gói tin được gửi đi ở dạng Multicast.
http://img99.imageshack.us/img99/2300/37358811no9.jpg (http://img99.imageshack.us/my.php?image=37358811no9.jpg)
http://img99.imageshack.us/img99/37358811no9.jpg/1/w116.png (http://g.imageshack.us/img99/37358811no9.jpg/1/)
III. Demand circuit
Quan hệ láng giềng thiết lập lần đầu nhưng sau này các gói Hello sẽ bị chặn lại và refresh LSA mỗi 30 phút cũng bị chặn để giảm chi phí không cần thiết [Point-to-Multipoint]. Còn các kiểu mạng khác Hello vẫn gửi qua cổng giao tiếp.
Có 2 tình huống mà LSA sẽ được gửi đi:
- Khi có sự thay đổi topology.
- Khi router trong OSPF domain không hiểu được demand circuit.
http://img514.imageshack.us/img514/8308/17513355yh8.jpg (http://img514.imageshack.us/my.php?image=17513355yh8.jpg)
http://img514.imageshack.us/img514/17513355yh8.jpg/1/w168.png (http://g.imageshack.us/img514/17513355yh8.jpg/1/)
IV. NonBroadcast-Multiaccess
http://img514.imageshack.us/img514/9716/70353726hd9.jpg (http://img514.imageshack.us/my.php?image=70353726hd9.jpg)
http://img514.imageshack.us/img514/70353726hd9.jpg/1/w159.png (http://g.imageshack.us/img514/70353726hd9.jpg/1/)
Là môi trường truyền dẫn như Framrelay, ATM, X.25. Và sau đây là chi tiết hơn:
http://img243.imageshack.us/img243/1259/84436370fn9.jpg (http://img243.imageshack.us/my.php?image=84436370fn9.jpg)
http://img243.imageshack.us/img243/84436370fn9.jpg/1/w674.png (http://g.imageshack.us/img243/84436370fn9.jpg/1/)
Nếu cấu hình dạng 1, 3, 5 thì bạn phải cho interface đó broadcast đi.
Nếu môi trường nào có bầu chọn DR, BDR thì các địa chỉ multicast sẽ sử dụng là 224.0.0.5 và 224.0.0.6 [ngoại trừ cấu hình bằng tay bằng lệnh neighbor thì tuy có bầu chọn nhưng vẫn là unicast]
Nếu trong frame-relay thì ta có thể cấu hình broadcast và không broadcast tương ứng với lệnh:
R1(config-if)#frame-relay map ip 192.168.1.1 102
R1(config-if)#frame-relay map ip 192.168.1.1 102 broadcast
Với OSPF mode thì ta có thể xem int đó ở dạng mode nào bằng cách “show ip ospf interface”. OSPF mode chỉ có tác dụng khi ta cấu hình cổng đó tham gia định tuyến OSPF.
R1#sh ip ospf interface
Serial2/1 is up, line protocol is down
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_MULTIPOINT, Cost: 64
A/ Cấu hình mối trường OSPF [OSPF mode]
R1(config)#interface serial 2/1
R1(config-if)#ip ospf network ?
broadcast Specify OSPF broadcast multi-access network
non-broadcast Specify OSPF NBMA network
point-to-multipoint Specify OSPF point-to-multipoint network
point-to-point Specify OSPF point-to-point network
Nhớ là đừng lẫn lộn giữa Frame-relay và “OSPF mode”
OSPF mode là cách mà OSPF xem trạng thái của cổng đó là loại môi trường nào [network type].
!
interface Serial2/1.1 multipoint
ip address 2.2.2.2 255.0.0.0
!
Nhưng “OSPF mode” (network type)
R1#sh ip os interface
Serial2/1.1 is up, line protocol is down
Internet Address 2.2.2.2/8, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64
Hai OSPF mode khác nhau có thể thiết lập được neighbors với nhau nhưng chưa chắc trao đổi thông tin cho nhau được
Vd: point-to-multipoint và broadcast.
Riêng OSPF mode point-to-multipoint non-broadcast và point-to-multipoint có thể thiết lập neighbor và trao đổi với nhau vì:
Bên nào có chữ broadcast [point-to-multipoint non-broadcast] thì nó sẽ gửi hello bằng multicast 224.0.0.5
Bên nào không có khả năng khám phá [point-to-multipoint] thì đợi con kia gửi hello thì nó sẽ gửi lại bằng unicast.
Nguyên do là “show ip ospf int” thì bạn vẫn thấy OSPF tự hiểu là point-to-multipoint mặc dầu có đánh thêm tử khóa vào:
R1(config-if)#ip ospf network point-to-multipoint non-broadcast
Chỉ khác một chỗ là nếu point-to-multipoint thì gửi hello như mạng point-to-point 224.0.0.5, còn point-to-multipoint non-broadcast chỉ có khả năng gửi unicast.
Gateway of last resort is not set
C 1.0.0.0/8 is directly connected, Loopback1
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 192.168.1.2, 00:02:17, Serial2/1
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 192.168.1.3, 00:02:17, Serial2/1
192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks
C 192.168.1.0/24 is directly connected, Serial2/1
O 192.168.1.3/32 [110/64] via 192.168.1.3, 00:02:17, Serial2/1
O 192.168.1.2/32 [110/64] via 192.168.1.2, 00:02:17, Serial2/1
Với 192.168.1.3, 192.168.1.2 là những Interface vật lí.
2.2.2.2, 3.3.3.3 là những loopback nên OSPF sẽ /32 luôn bởi vì OSPF là giao thức dạng linkstate. Nó sẽ tự hiểu trạng thái cổng đó là gì luôn chứ không như Distace => Nó hiểu loopback không kết nối với bất cứ mạng nào nữa nên nó cứ /32 luôn.
=> Cách học của OSPF trên trong môi trường point-to-multipoint hoặc point-to-multipoint non-broadcast có hơi lạ một tí.
Còn có một dạng neighbor được thiết lập bởi virtual-link. Nó cũng tương tự point-to-point trạng thái sau khi thiết lập neighbor là Full/-. Nhưng vì nó thiết lập trên cơ sở hạ tầng có sẵn nên nó không cần age [DoNotAge: DNA]. DNA được yêu cầu vì việc flood LSA update liên tục là thừa trên Virtual-link là thừa khi mà đường vật lí vẫn up.
phamminhtuan
17-11-2008, 01:38 PM
Hôm nay Ôn lại Các môi loại LSA trong OSPF.
Nhìn hình thì có tới 11 loại nhưng chỉ xài 8 loại, 3 loại còn lại cho tương lai xài
http://img403.imageshack.us/img403/7650/typebp2.jpg (http://img403.imageshack.us/my.php?image=typebp2.jpg)
http://img403.imageshack.us/img403/typebp2.jpg/1/w461.png (http://g.imageshack.us/img403/typebp2.jpg/1/)
I. LSA loại 1
Ttất cả các router trong cùng area phát ra LSA này.
Vd:
http://img525.imageshack.us/img525/4961/broadcast1kq5.jpg (http://img525.imageshack.us/my.php?image=broadcast1kq5.jpg)
http://img525.imageshack.us/img525/broadcast1kq5.jpg/1/w624.png (http://g.imageshack.us/img525/broadcast1kq5.jpg/1/)
R3#show ip ospf database router
OSPF Router with ID (3.3.3.3) (Process ID 1) => Đang chạy OSPF datebase trên router với router ID là 3.3.3.3
Router Link States (Area 0)
LS age: 1150 => tuổi của LSA type 1 [Router Link States] từ lúc nhận vào LSA này.
Options: (No TOS-capability, DC)
LS Type: Router Links => LSA loại 1
Link State ID: 1.1.1.1 => Router ID của router quảng bá
Advertising Router: 1.1.1.1 => Router ID của router quảng bá
LS Seq Number: 80000004
Checksum: 0xBBB0
Length: 60
Number of Links: 3
Link connected to: a Stub Network => Vì đường mạng này là cuối cùng nên Router Link States cho nó là kết nối với stub.
(Link ID) Network/subnet number: 172.16.0.0 => chỉ rõ network của interface tham gia định tuyến.
(Link Data) Network Mask: 255.255.0.0 => chỉ rõ subnetmask của interface tham gia định tuyến.
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.1.3 => Chỉ ra router DR của mạng
(Link Data) Router Interface address: 192.168.1.1 => Chỉ ra interface kết nối tới mạng
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network => Vì loopback không kết nối thêm bất cứ network nào nữa nên Router Link States cho nó là kết nối với stub.
(Link ID) Network/subnet number: 1.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
LS age: 1750
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 80000003
Checksum: 0x8CA1
Length: 48
Number of Links: 2
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.1.3
(Link Data) Router Interface address: 192.168.1.2
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 2.2.2.2
(Link Data) Network Mask: 255.255.255.255 => vì là loopback nên nó luôn hiểu là /32 vì giao thức linkstate như bài trên đã nói.
Number of TOS metrics: 0
TOS 0 Metrics: 1
LS age: 1766
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 3.3.3.3
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0xA080
Length: 48
Number of Links: 2
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.1.3
(Link Data) Router Interface address: 192.168.1.3
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 3.3.3.3
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
http://img101.imageshack.us/img101/2843/broadcast2zz1.jpg (http://img101.imageshack.us/my.php?image=broadcast2zz1.jpg)
http://img101.imageshack.us/img101/broadcast2zz1.jpg/1/w662.png (http://g.imageshack.us/img101/broadcast2zz1.jpg/1/)
Với mô hình bên trên khi thêm R4 vào [nhớ kết nối qua serial] ở môi trường point-to-point.
Router mới kết nối thêm ở dạng point-to-point
LS age: 326
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 192.1.1.2 =>Router ID
Advertising Router: 192.1.1.2 =>Router ID
LS Seq Number: 80000002
Checksum: 0xB2DF
Length: 72
Number of Links: 4
Link connected to: a Stub Network
(Link ID) Network/subnet number: 4.4.4.4
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 192.1.4.0 => không kết nối với ai xem như nó là cuối cùng, cũng được xem như kết nối với Stub Network
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point) => vì mình kết nối là serial => point-to-point
(Link ID) Neighboring Router ID: 2.2.2.2
(Link Data) Router Interface address: 192.1.1.2
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 192.1.1.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
Khi thêm Router R5
LS age: 125
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 80000008
Checksum: 0x67D4
Length: 84
Number of Links: 5
Link connected to: a Transit Network => Các router ở các vùng khác nhau muốn thông được với nhau thì phải vận chuyển qua vùng này. Vì thế nên gọi vùng này là Transit Network.
(Link ID) Designated Router address: 192.168.15.1
(Link Data) Router Interface address: 192.168.15.1
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 192.1.1.2
(Link Data) Router Interface address: 192.1.1.1
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Stub Network
(Link ID) Network/subnet number: 192.1.1.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.1.3
(Link Data) Router Interface address: 192.168.1.2
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 2.2.2.2
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
LS age: 189
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 192.168.15.2
Advertising Router: 192.168.15.2
LS Seq Number: 80000003
Checksum: 0xC260
Length: 48
Number of Links: 2
Link connected to: a Stub Network
(Link ID) Network/subnet number: 5.5.5.5
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.15.1
(Link Data) Router Interface address: 192.168.15.2
Number of TOS metrics: 0
TOS 0 Metrics: 1
R3#show ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/2] via 192.168.1.1, 00:07:08, FastEthernet1/1
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 192.168.1.2, 00:07:08, FastEthernet1/1
O 192.168.15.0/24 [110/2] via 192.168.1.2, 00:07:08, FastEthernet1/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/66] via 192.168.1.2, 00:07:08, FastEthernet1/1
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/3] via 192.168.1.2, 00:07:08, FastEthernet1/1
O 172.16.0.0/16 [110/2] via 192.168.1.1, 00:07:08, FastEthernet1/1
O 192.1.4.0/24 [110/66] via 192.168.1.2, 00:07:08, FastEthernet1/1
O 192.1.1.0/24 [110/65] via 192.168.1.2, 00:07:08, FastEthernet1/1
Ta có thể xem cost của OSPF và rất nhiều thông số khác chỉ với một lệnh
R2#show ip ospf interface
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.15.1/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 192.168.15.1
Backup Designated router (ID) 192.168.15.2, Interface address 192.168.15.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Index 4/4, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 4 msec, maximum is 4 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 192.168.15.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Serial2/2 is up, line protocol is up
Internet Address 192.1.1.1/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Index 3/3, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 192.1.1.2
Suppress hello for 0 neighbor(s)
FastEthernet1/0 is up, line protocol is up
Internet Address 192.168.1.2/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 3.3.3.3, Interface address 192.168.1.3
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:08
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 1.1.1.1
Adjacent with neighbor 3.3.3.3 (Designated Router)
Suppress hello for 0 neighbor(s)
Loopback1 is up, line protocol is up
Internet Address 2.2.2.2/8, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
phamminhtuan
17-11-2008, 01:49 PM
II. LSA loại 2
Do router DR phát ra.
R3#sh ip os database network
OSPF Router with ID (3.3.3.3) (Process ID 1)
Net Link States (Area 0)
Routing Bit Set on this LSA
LS age: 34
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 192.168.1.3 (address of Designated Router) => cổng phát ra gói LSA loại 2
Advertising Router: 3.3.3.3 => Router ID của DR
LS Seq Number: 80000002
Checksum: 0x8D16
Length: 36
Network Mask: /24
Attached Router: 3.3.3.3
Attached Router: 1.1.1.1
Attached Router: 2.2.2.2
[3 dòng attached là số router gắn trực tiếp với nó là R1,R2 và chính nó]
Routing Bit Set on this LSA
LS age: 40
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 192.168.15.2 (address of Designated Router)
Advertising Router: 5.5.5.5
LS Seq Number: 80000001
Checksum: 0xACE2
Length: 32
Network Mask: /24
Attached Router: 5.5.5.5
Attached Router: 2.2.2.2
Muốn xem interface nào tham gia và trở thành DR cho segment nào đó thì ta cũng dùng lệnh “show ip ospf interface”
R5#sh ip os interface
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.15.2/24, Area 0
Process ID 1, Router ID 5.5.5.5, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 5.5.5.5, Interface address 192.168.15.2
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.15.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:02
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Loopback5 is up, line protocol is up
Internet Address 5.5.5.5/8, Area 0
Process ID 1, Router ID 5.5.5.5, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
R3# sh ip os interface
FastEthernet1/1 is up, line protocol is up
Internet Address 192.168.1.3/24, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 3.3.3.3, Interface address 192.168.1.3
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 4
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 1.1.1.1
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Loopback3 is up, line protocol is up
Internet Address 3.3.3.3/24, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
R1#sh ip os interface
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DROTHER, Priority 1
Designated Router (ID) 3.3.3.3, Interface address 192.168.1.3
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:01
Index 3/3, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Adjacent with neighbor 3.3.3.3 (Designated Router)
Suppress hello for 0 neighbor(s)
FastEthernet1/0 is up, line protocol is up
Internet Address 172.16.1.1/16, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 172.16.1.1
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:00
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
Loopback1 is up, line protocol is up
Internet Address 1.1.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Do đó một router có thể là DR cho mạng này nhưng lại có thể là BDR hoặc Drother cho mạng khác.
R2#sh ip os interface
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.15.1/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 192.168.15.1
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:00
Index 4/4, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
FastEthernet1/0 is up, line protocol is up
Internet Address 192.168.1.2/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 3.3.3.3, Interface address 192.168.1.3
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:00
Index 3/3, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 1.1.1.1
Adjacent with neighbor 3.3.3.3 (Designated Router)
Suppress hello for 0 neighbor(s)
Serial2/2 is up, line protocol is down
Internet Address 192.1.1.1/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State DOWN,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Loopback1 is up, line protocol is up
Internet Address 2.2.2.2/8, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
phamminhtuan
17-11-2008, 05:07 PM
Ta củng cố kiến thức chút rồi bắt đầu với Types 3,4,5 trong OSPF nào.
http://img522.imageshack.us/img522/6389/type3oe6.jpg (http://img522.imageshack.us/my.php?image=type3oe6.jpg)
http://img522.imageshack.us/img522/type3oe6.jpg/1/w496.png (http://g.imageshack.us/img522/type3oe6.jpg/1/)
Nhớ là R1 có loopback 1.1.1.1 và R2 có loopback 2.2.2.2 nhưng không cho tham gia định tuyến [để thấy kết quả bên dưới].
Thường thì khi làm OSPF không cần quảng bá mạng loopback [nó chỉ làm gia tăng bảng định tuyến].
R2#sh ip os database router
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 1)
Routing Bit Set on this LSA
LS age: 209
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000002
Checksum: 0x86B4
Length: 36
Area Border Router
Number of Links: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.12.2 => Không phải 2.2.2.2 vì 2.2.2.2 không cho tham gia định tuyến [đây là inter lớn nhất của DR đã tham gia vào định tuyến OSPF]
(Link Data) Router Interface address: 192.168.12.1 => Interface tham gia vào định tuyến
Number of TOS metrics: 0
TOS 0 Metrics: 1
LS age: 209
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 80000002
Checksum: 0x45ED
Length: 36
Number of Links: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.12.2
(Link Data) Router Interface address: 192.168.12.2
Number of TOS metrics: 0
TOS 0 Metrics: 1
R2#sh ip os database network
OSPF Router with ID (2.2.2.2) (Process ID 1)
Net Link States (Area 1)
Routing Bit Set on this LSA
LS age: 468
Options: (No TOS-capability, DC)
LS Type: Network Links
Link State ID: 192.168.12.2 (address of Designated Router)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x8F1F
Length: 32
Network Mask: /24
Attached Router: 2.2.2.2
Attached Router: 1.1.1.1
phamminhtuan
17-11-2008, 05:08 PM
III. LSA3
Mô tả những routes hoặc những summary route được học từ area khác.
*Nhớ đừng lẫn lộn thấy nó ghi summary thì là những route được summary, không phải như vậy. Mà là bảng tóm tắt những route học từ area khác và do con nào quảng bá tới. ABR giữa những area khác nhau làm nhiệm vụ giống distance vector nên ta có thể summary những chỗ này.
Còn trong area linkstate gửi các gói LSA1 và LSA2 ở trạng thái [state] chứ không phải route nên ta không thể summary trong cùng area.
http://img522.imageshack.us/img522/6389/type3oe6.jpg (http://img522.imageshack.us/my.php?image=type3oe6.jpg)
http://img522.imageshack.us/img522/type3oe6.jpg/1/w496.png (http://g.imageshack.us/img522/type3oe6.jpg/1/)
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
C 2.0.0.0/8 is directly connected, Loopback2
C 192.1.1.0/24 is directly connected, Serial2/2
O IA 192.168.1.0/24 [110/2] via 192.168.12.1, 00:00:03, FastEthernet0/0
Những route học từ các area khác sẽ có chữ IA [internal area]. Mặc định không summary route.
R2#sh ip os database summary
Lúc này show lệnh này sẽ thấy
OSPF Router with ID (2.2.2.2) (Process ID 1)
Summary Net Link States (Area 1)
Routing Bit Set on this LSA
LS age: 733
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 192.168.1.0 (summary Network Number)
Advertising Router: 1.1.1.1
LS Seq Number: 80000001
Checksum: 0xB815
Length: 28
Network Mask: /24
TOS: 0 Metric: 1
R1#sh ip ospf database summary
OSPF Router with ID (1.1.1.1) (Process ID 1)
Summary Net Link States (Area 0)
LS age: 294
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 192.168.12.0 (summary Network Number) [mạng của interface tham gia OSPF]
Advertising Router: 1.1.1.1
LS Seq Number: 80000001
Checksum: 0x3F83
Length: 28
Network Mask: /24
TOS: 0 Metric: 1
Summary Net Link States (Area 1)
LS age: 289
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 192.168.1.0 (summary Network Number)
Advertising Router: 1.1.1.1
LS Seq Number: 80000001
Checksum: 0xB815
Length: 28
Network Mask: /24
TOS: 0 Metric: 1
Bảng này trên 2 con có khác nhau [vì R2 chỉ có 1 area còn R1 có tới 2 area 1 và area 0]
Sau đó thử xóa route có chữ IA bằng cách vào R1
R1(config)#router ospf 1
R1(config-router)#no network 192.168.1.0 0.0.0.255 area 0
Rồi R1#sh ip ospf database summary
Và thấy không có mô tả gì cả.
phamminhtuan
17-11-2008, 05:11 PM
IV. LSA4
Là do con ABR để xác định con ASBR
Với ABR là area border router: con mà có ranh giới giữa nhiều vùng, thường là vùng 0 và các vùng khác.
Và ASBR là con nối giữa 2 hoặc nhiều AS: Autonomous system, chẳng hạn như OSPF và các giao thức khác như RIP, EIGRP, …
*Cisco khuyến cáo chỉ nên dùng 3 area trên một con ABR.
http://img267.imageshack.us/img267/6283/type4pm1.jpg (http://img267.imageshack.us/my.php?image=type4pm1.jpg)
http://img267.imageshack.us/img267/type4pm1.jpg/1/w481.png (http://g.imageshack.us/img267/type4pm1.jpg/1/)
Khi cấu hình mô hình trên xong ta "show ip ospf database asbr-summary"
R1#sh ip ospf database asbr-summary
OSPF Router with ID (1.1.1.1) (Process ID 1)
R2#sh ip ospf database asbr-summary
OSPF Router with ID (2.2.2.2) (Process ID 1)
Sau đó vào R2 resdistribute rip vào OSPF để R1 học được các route từ RIPv2
R2(config)#router ospf 1
R2(config-router)#redistribute rip metric 64 subnets
R1# sh ip ospf database asbr-summary
OSPF Router with ID (1.1.1.1) (Process ID 1)
Summary ASB Link States (Area 0)
LS age: 117
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(AS Boundary Router)
Link State ID: 2.2.2.2 (AS Boundary Router address)
Advertising Router: 1.1.1.1
LS Seq Number: 80000001
Checksum: 0xB24
Length: 28
Network Mask: /0
TOS: 0 Metric: 1
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
C 1.0.0.0/8 is directly connected, Loopback1
O E2 3.0.0.0/8 [110/64] via 192.168.12.2, 00:07:20, FastEthernet0/0
O E2 192.1.1.0/24 [110/64] via 192.168.12.2, 00:07:20, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet1/0
Những route được học từ những vùng bên ngoài sẽ có chữ E [external]
E1: giá trị cost sẻ cộng dồn khi đi vào sâu trong OSPS, để giúp cho ta xác định chính xác đường nào ngắn hơn nếu có nhiều đường cùng tới môt ASBR.
E2: giá trị cost sẽ không được cộng dồn khi đi vào trong OSPF, thường dùng khi có một đường tới ASBR
phamminhtuan
17-11-2008, 05:12 PM
V. LSA 5
Mô tả về những route từ bên ngoài vào trong OSPF.
Và mặc định là các giao thức linkstate không summary route học từ bên ngoài.
R1#sh ip ospf database external
OSPF Router with ID (1.1.1.1) (Process ID 1)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 927
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 3.0.0.0 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x3E2B
Length: 36
Network Mask: /8 => Do RIP quảng bá 3.3.3.3/24 tới R2 qua 192.1.1.0/24 => mạng giá đoạn, nên R2 sẽ học /8 => R1 học /8 luôn. [tự sum về major là do RIPv2 ]
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 64
Forward Address: 0.0.0.0
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 927
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 192.1.1.0 (External Network Number ) [đây là mạng nối giữa R2 và R3 cũng là RIP => bị redistribute ]
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x8425
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 64
Forward Address: 0.0.0.0
External Route Tag: 0
phamminhtuan
17-11-2008, 05:13 PM
Và đây là show run của cả 3 con [router 7200]
R1#sh run
Building configuration...
Current configuration : 1497 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
ip audit po max-events 100
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback1
ip address 1.1.1.1 255.0.0.0
!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
no keepalive
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/7
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
network 192.168.12.0 0.0.0.255 area 1
!
ip classless
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
R2#sh run
Building configuration...
Current configuration : 1522 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
ip audit po max-events 100
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback2
ip address 2.2.2.2 255.0.0.0
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
duplex half
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
ip address 192.1.1.1 255.255.255.0
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/7
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
redistribute rip metric 64 subnets
network 192.168.12.0 0.0.0.255 area 1
!
router rip
version 2
network 192.1.1.0
!
ip classless
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
End
R3#sh run
Building configuration...
Current configuration : 1433 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
ip audit po max-events 100
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback3
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
ip address 192.1.1.2 255.255.255.0
serial restart-delay 0
clock rate 64000
!
interface Serial2/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/7
no ip address
shutdown
serial restart-delay 0
!
router rip
version 2
network 3.0.0.0
network 192.1.1.0
!
ip classless
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
End
phamminhtuan
17-11-2008, 05:30 PM
Còn Nếu muốn bằng tay summary để làm gọn bảng routing thì trong ospf có 2 loại:
1.Summary các route học từ bên ngoài AS khác vào AS OSPF [làm trên con ASBR]
R2(config)#router ospf 1
R2(config-router)#summary-address ip-address mask [not-advertise] [tag tag]
2. Summary các route từ area khác gửi qua
R1(config)#router ospf 1
R1(config-router)#area area-id range address mask [advertise | not-advertise] [cost cost]
phamminhtuan
17-11-2008, 05:34 PM
Mình viết có chỗ nào sai hay thiếu mấy bạn xem rồi sửa giúp mình :54:.
phamminhtuan
18-11-2008, 11:08 AM
Hôm nay mình post tiếp về Virtual-link
Virtual-link trong OSPF chỉ là một giải pháp mang tính tạm thời khi không còn cách nào tốt đẹp hơn để cho các mạng thấy nhau được. Ngoài ra nó còn dùng trong trường hợp backup đường chính [người ta tạo ta đường virtual để dự phòng sẵn khi đường chính down]
http://img341.imageshack.us/img341/8710/virtuallinkru0.jpg (http://img341.imageshack.us/my.php?image=virtuallinkru0.jpg)
http://img341.imageshack.us/img341/virtuallinkru0.jpg/1/w441.png (http://g.imageshack.us/img341/virtuallinkru0.jpg/1/)
R1#sh run
Building configuration...
Current configuration : 1510 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
ip audit po max-events 100
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback1
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 192.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/7
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 1
network 192.1.1.0 0.0.0.255 area 0
network 192.168.12.0 0.0.0.255 area 1
!
ip classless
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
End
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback1
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 192.168.12.2, 00:00:58, FastEthernet0/0
C 192.1.1.0/24 is directly connected, FastEthernet1/0
R2#sh run
Building configuration...
Current configuration : 1611 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
ip audit po max-events 100
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback2
ip address 2.2.2.2 255.255.0.0
!
interface Loopback3
ip address 23.23.23.23 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 192.168.23.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/7
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 1
network 23.23.23.0 0.0.0.255 area 2
network 192.168.12.0 0.0.0.255 area 1
network 192.168.23.0 0.0.0.255 area 2
!
ip classless
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
End
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/2] via 192.168.12.1, 00:01:41, FastEthernet0/0
2.0.0.0/16 is subnetted, 1 subnets
C 2.2.0.0 is directly connected, Loopback2
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.23.2, 00:18:27, FastEthernet1/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Loopback3
C 192.168.23.0/24 is directly connected, FastEthernet1/0
O IA 192.1.1.0/24 [110/2] via 192.168.12.1, 00:01:41, FastEthernet0/0
R3#sh run
Building configuration...
Current configuration : 1483 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
ip audit po max-events 100
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback3
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface FastEthernet1/0
ip address 192.168.23.2 255.255.255.0
ip ospf priority 0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/7
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
network 3.3.3.0 0.0.0.255 area 2
network 192.168.23.0 0.0.0.255 area 2
!
ip classless
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
R3#sh ip ro
R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback3
23.0.0.0/32 is subnetted, 1 subnets
O 23.23.23.23 [110/2] via 192.168.23.1, 00:23:24, FastEthernet1/0
C 192.168.23.0/24 is directly connected, FastEthernet1/0
Lúc này R1 sẽ không thấy routes R3 và R3 không thấy routes R1.
Ta cấu hình virtual-link trên R1 và R2 [Lúc này virtual trở thành đường transit để vận chuyển các route của R3 qua vùng 0 [area 0] của R1]
R1(config)#router ospf 1
R1(config-router)#area 1 virtual-link 23.23.23.23
*Nov 18 10:38:34.435: %OSPF-5-ADJCHG: Process 1, Nbr 23.23.23.23 on OSPF_VL0 from LOADING to FULL, Loading Done
R2(config)#router ospf 1
R2(config-router)#area 1 virtual-link 1.1.1.1
*Nov 18 10:38:34.343: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on OSPF_VL0 from LOADING to FULL, Loading Done
Cấu trúc lệnh “area area-ID virtual-link Router-ID của neighbor”
R2#sh ip os neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 0 FULL/ - - 192.168.12.1 OSPF_VL0
1.1.1.1 1 FULL/BDR 00:00:38 192.168.12.1 FastEthernet0/0
3.3.3.3 0 FULL/DROTHER 00:00:33 192.168.23.2 FastEthernet1/
Lúc này ta vào lại R1
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback1
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 192.168.12.2, 00:03:57, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/3] via 192.168.12.2, 00:03:47, FastEthernet0/0
23.0.0.0/32 is subnetted, 1 subnets
O IA 23.23.23.23 [110/2] via 192.168.12.2, 00:03:47, FastEthernet0/0
O IA 192.168.23.0/24 [110/2] via 192.168.12.2, 00:03:47, FastEthernet0/0
C 192.1.1.0/24 is directly connected, FastEthernet1/0
Và R3
R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
O IA 192.168.12.0/24 [110/2] via 192.168.23.1, 00:04:53, FastEthernet1/0
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/3] via 192.168.23.1, 00:04:53, FastEthernet1/0
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/2] via 192.168.23.1, 00:04:53, FastEthernet1/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback3
23.0.0.0/32 is subnetted, 1 subnets
O 23.23.23.23 [110/2] via 192.168.23.1, 00:04:53, FastEthernet1/0
C 192.168.23.0/24 is directly connected, FastEthernet1/0
O IA 192.1.1.0/24 [110/3] via 192.168.23.1, 00:04:33, FastEthernet1/0
So sánh LSA lúc chưa và sau khi đã thiết lập virtual-link
R3#sh ip os database router [Lúc chưa thiết lập virtual-link]
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 2)
LS age: 906
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 3.3.3.3
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0x6692
Length: 48
Number of Links: 2
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.23.1
(Link Data) Router Interface address: 192.168.23.2
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 3.3.3.3
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
LS age: 24
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 23.23.23.23
Advertising Router: 23.23.23.23
LS Seq Number: 80000004
Checksum: 0xCC3A
Length: 48
Number of Links: 2
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.23.1
(Link Data) Router Interface address: 192.168.23.1
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 23.23.23.23
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
R3#sh ip os database router [Lúc đã thiết lập virtual-link]
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 2)
LS age: 798
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 3.3.3.3
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0x6692
Length: 48
Number of Links: 2
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.23.1
(Link Data) Router Interface address: 192.168.23.2
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 3.3.3.3
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Routing Bit Set on this LSA
LS age: 391
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 23.23.23.23
Advertising Router: 23.23.23.23
LS Seq Number: 80000003
Checksum: 0xD135
Length: 48
Area Border Router
Number of Links: 2
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.23.1
(Link Data) Router Interface address: 192.168.23.1
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 23.23.23.23
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Trước khi có virtual-link
R3#sh ip os database summary
OSPF Router with ID (3.3.3.3) (Process ID 1)
Sau khi có virtual-link
R3#sh ip os database summary
OSPF Router with ID (3.3.3.3) (Process ID 1)
Summary Net Link States (Area 2)
Routing Bit Set on this LSA
LS age: 6
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 1.1.1.1 (summary Network Number)
Advertising Router: 23.23.23.23
LS Seq Number: 80000001
Checksum: 0xBA20
Length: 28
Network Mask: /32
TOS: 0 Metric: 2
Routing Bit Set on this LSA
LS age: 6
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 2.2.2.2 (summary Network Number)
Advertising Router: 23.23.23.23
LS Seq Number: 80000001
Checksum: 0x8255
Length: 28
Network Mask: /32
TOS: 0 Metric: 1
Routing Bit Set on this LSA
LS age: 6
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 192.168.12.0 (summary Network Number)
Advertising Router: 23.23.23.23
LS Seq Number: 80000001
Checksum: 0xA8C1
Length: 28
Network Mask: /24
TOS: 0 Metric: 1
Ta có thể xem bảng tóm tắt của các loại LSA bằng lệnh
R3#sh ip os database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 1613 0x80000002 0x006692 2
23.23.23.23 23.23.23.23 30 0x80000007 0x00C939 2
Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
192.168.23.1 23.23.23.23 1614 0x80000001 0x00D81B
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 23.23.23.23 30 0x80000001 0x00BA20
2.2.2.2 23.23.23.23 30 0x80000001 0x008255
192.1.1.0 23.23.23.23 5 0x80000001 0x000814
192.168.12.0 23.23.23.23 30 0x80000001 0x00A8C1
Màu nâu là các route học được từ bên ngoài
R1#sh ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 98 0x80000006 0x00A7D4 2
23.23.23.23 23.23.23.23 1 (DNA) 0x80000006 0x0033C3 1
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 1.1.1.1 1738 0x80000001 0x0047EC
1.1.1.1 23.23.23.23 11 (DNA) 0x80000001 0x00BA20
2.2.2.2 1.1.1.1 1683 0x80000001 0x00230C
2.2.2.2 23.23.23.23 11 (DNA) 0x80000001 0x008255
3.3.3.3 23.23.23.23 11 (DNA) 0x80000001 0x005E74
23.23.23.23 23.23.23.23 11 (DNA) 0x80000001 0x00B8CA
192.168.12.0 1.1.1.1 1687 0x80000003 0x003B85
192.168.12.0 23.23.23.23 11 (DNA) 0x80000001 0x00A8C1
192.168.23.0 23.23.23.23 11 (DNA) 0x80000001 0x002F30
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1698 0x80000002 0x0066BF 2
23.23.23.23 23.23.23.23 110 0x80000007 0x002E3D 2
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.12.2 23.23.23.23 1699 0x80000001 0x00E322
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
3.3.3.3 1.1.1.1 94 0x80000001 0x00FE2B
3.3.3.3 23.23.23.23 110 0x80000001 0x005E74
23.23.23.23 1.1.1.1 94 0x80000001 0x005981
23.23.23.23 23.23.23.23 110 0x80000001 0x00B8CA
192.1.1.0 1.1.1.1 1738 0x80000001 0x0094E0
192.1.1.0 23.23.23.23 85 0x80000001 0x000814
192.168.23.0 1.1.1.1 94 0x80000001 0x00CFE6
192.168.23.0 23.23.23.23 110 0x80000001 0x002F30
dophin_85
28-11-2008, 11:28 AM
Các bạn cho mình hỏi là việc bầu chọn DR,BDR thì có như master/Slaver trong môi trường PPP ko, và việc bầu chọn đó nằm ở trạng thái 2-way hay Extart.
duanvcd
28-11-2008, 04:49 PM
@logmein: Đọc mấy cái đầu còn hay, càng về sau thấy càng....3 chấm bác ạ
Đã nói là củng cố thì chỉ nói vắn tắt và trọng tâm vào những ý chính thôi. Nhiều cái bác nói lan man quá!!!
Nhưng mà bác làm như thế này là cung-fu panda lắm rồi. Khâm phục :d
dophin_85: Các bạn cho mình hỏi là việc bầu chọn DR,BDR thì có như master/Slaver trong môi trường PPP ko, và việc bầu chọn đó nằm ở trạng thái 2-way hay Extart.
Reply With Quote
1. Quá trình bầu chọn DR/BDR cũng diễn ra Master/Slave ở trạng thái Exstart nhằm quyết định Router nào sẽ nắm vai trò chủ đạo trong quá trình đồng bộ hóa database giữa 2 Router.
2. Quá trình bầu chọn DR/BDR xảy ra ở trạng thái 2-way. Trạng thái 2-way vừa để thiết lập quan hệ Neighbor vừa bầu chọn DR/BDR. Bạn có thể thấy rõ quá trình từ Down State đến Full qua câu lệnh: Debug ip ospf adj
November02
15-05-2009, 10:48 AM
Hi,
Thanks logmeinvietnam về hệ thống lại kiến thức OSPF. Còn phần các loại area, cậu là tiếp 1 Tut nữa nhé :)
obama6493
23-02-2011, 11:29 PM
nối 2 area khác không vào nhau
Mình mới học single are thôi :D
Còn con nào bật lên trước thì sẽ là DR, vì cho một ví dụ cụ thể là mạng cha và mạng con nối ở các chi nhánh khác nhau. Mạng cha đang làm DR, không lẽ mạng con cắm một router nào đó hoặc thay đổi RouterID chi nhánh của mình thì nó chi nhánh đó sẽ thành DR sao.
OSPF là giao thức không chiếm quyền. Tức là 1 router đã là DR thì 1 router khác mới cài đặt vào dù RouterID của nó cao hơn vẫn chỉ là router bình thường (DROTHERS)
1.Tất cả các router tự xem nó là DR và BDR của mạng đó [thỏa dk priority > 0 và twoway]
Theo mình nghĩ cái này xảy ra khi mạng chưa có DR và BDR thôi. Khi đó mỗi con Router tự cho nó là DR với ID của nó. Sau khi so sánh ID với các Router khác qua gói Hello LSA thì mới quyết định được Router nào là DR, chứ có DR rồi thì bầu chọn làm chi??
Uh thì ở trên tui cũng có ý là nó không thể chiếm quyền khi đã có DR ngoại trừ khi reboot lại, hoặc bằng lệnh "clear ip ospf process" [mà lệnh này ít khí ảnh hưởng được lắm trừ khi con muốn chiếm quyền và con DR cùng làm lệnh này]
Còn ở trên là khi không có DR và BDR thì nó mới bầu, tui hết sức tán thành với ông.
hanoi2011
24-05-2011, 02:59 PM
Trong đợt thực tập chuyên ngành, mình có làm về định tuyến OSPF từ cơ bản tới nâng cao (nhưng chỉ tới CCNP chút thui).
Nên trong topic này, mình gửi các bạn tham khảo.
1. Phần lý thuyết cụ thể, tổng hợp (vì làm thực tập nên k được quá 70 trang), nên mình làm lý thuyết rất tổng hợp, nên cũng dễ hiểu.( Bao gồm : file word, pp và pdf)http://www.mediafire.com/?qgimd35vod8u8iw
2. Phần mềm cài đặt
Here :http://www.mediafire.com/?y7oj19bnesgsgs9
3. Phần triển khai demo :
- - Cấu hình OSPF cơ bản.
- - Cấu hình Single-Area và Multi-Area OSPF.
- - Cấu hình đường tổng hợp : bên trong và bên ngoài.
- - Cấu hình các khu vực đặc biệt : Area 0, Stub area , Total Stubby area , NSSA area.
- - Phân biệt các loại gói tin trong OSPF : LSAs loại 1, 2, 3, 4, 5, 7…
(Kết hợp cùng với EIGRP)
- - Cấu hình loại mạng OSPF : P2P, P2M, NBMA..
- - Cấu hình OSPF Frame Relay trong mạng NBMA.
- - Cấu hình Virtual – Link trong OSPF.
- - Cấu hình xác thực : mật khẩu đơn giản, MD5.
Here : http://www.mediafire.com/?jnuqqa9idivxa3p
P.s : mình dag dùng 3G, nên mạng hơi yếu, nếu bạn nào cần thêm tài liệu về OSPF,
Pm mình , mình gửi link sau :
Gmail : nganbnn@gmail.com
mrvotuan
10-09-2011, 10:46 AM
Kho ebook cực hay cho anh/em download ôn kiến thức mạng - hệ thống!
http://www.vnsoftware.com.vn/categories0/groupm/18/download.html
beastofprey
22-12-2011, 10:03 AM
Mình chưa hiểu rõ về Virtual-link lắm . Mình đọc thấy những router nào không có đường kết nối trực tiếp với Area0 thì dùng đến Virtual-link. Bây giờ giả sử mạng trên có thêm 2 router như trong hình thì lúc đó sẽ cấu hình Virtual-link thế nào để các Router học được hết các mạng ạ? Cấu hình lần lượt R2 Virtual-link với R1 và R3 hay tạo Virtual-link R2,R3,R4 với R1 ???3965
luancb
22-12-2011, 10:33 AM
Virtual link chỉ qua 1 area thôi, nếu nhiều area nối tiếp nữa thì phải nhiều virtual link bạn !
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.