Presentation on theme: "OSPF Header OSPF HEADER OSPF HEADER for this project Types we will use"— Presentation transcript:
1OSPF Header OSPF HEADER OSPF HEADER for this project Types we will use Version (1 byte)Pkt type (1 byte)Length of Pkt (2 bytes)Source Router ID (4 bytes)Area ID (4 bytes)Checksum (2 bytes)Authentication type (2 bytes)Authentication data (8 bytes)2Typedon’t careIP:PORT (8 bytes!!)Don’t careType = 1 -> HELLOType = 3 -> link state requestType = 4 -> link state updateType = 5 -> link state ACKTypes we will use
2HELLO Packet standard this project OSPF Header withType = 1 (HELLO)OSPF Header withType = 1 (HELLO)Network Mask (4 bytes)Don’t care (4 bytes)Hello Interval (2 bytes)10 (2 bytes)standardNeighbors are the Ids (IP:Port) that have been send a HELLO since the in the previous 40 seconds (dead interval).Put the senders ID last as a delimiter.optionsprioritythis projectDon’tcareDead interval (4 bytes)40 (4 bytes)Designated router(4 bytes)Don’t care(4 bytes)Backup designated router(4 bytes)Don’t care(4 bytes)1st recent neighbor ID(4 bytes)1st Neighbor ID(8 bytes)last recent neighbor ID(4 bytes)SENDER ID(8 bytes)
3HELLO ProtocolEvery hello interval (10 sec) you must send out a hello to ALL neighbors. The HELLOs are even sent across links that seem to be down.During initialization, a HELLO is sent to all neighbors.If a HELLO is received and 1. The receiving node is listed in the recent neighbors list and 2. the sending node’s BIDIRECTIONAL flag is zero, then set it to one and send immediately respond with a HELLO, with, of course, the node that just sent the HELLO on the recent neighbors list.If a HELLO is received and the receiving node is not listed in the recent neighbors list, then immediately respond with a HELLO, with, of course, the node that just sent the HELLO on the recent neighbors list.Whenever a HELLO is received, set the sending node’s LAST_HELLO_TIME to the current time.
4The Link State Update packet LSAOSPF Header withType = 4 (update)LSA AgeoptionsLS typeLink State ID4 bytesNumber of LSAsLSA1Advertising router4 bytesLSA HeaderLS Sequence Number4 bytesLSA2checksumlengthrouter typeNumber of LinksLink ID4 bytesLink Data6 bytesLink 1Link typeTOSmetric
5The Link State Update Packet for Project LSALSA AgeDon’tcareOSPF Header withType = 4 (update)Link State ID8 bytesdon’t care4 bytesNumber of LSAsLSA HeaderLS Sequence Number4 bytesLSA1don’t caredon’t careLSA2Don’tcareNumber of LinksLink ID8 bytesLink Data6 bytesLink 1Link typeTOSmetric
6Database Exchange This is not according to the OSPF standard. It will generate more control traffic than the standard, and will not work in all situations. But, it is simpler to program and will suffice for this project.When a link switches to bidirectional, a full database exchange should take place.Suppose that node A has switched its bidirectional flag to node B to one,then node A initializes a database exchange:Node A sends an OSPF link state request packet to node B.Node B responds by all its LSA’s in one packet.If A does not get a LSA from B within 2 seconds, A resends an OSPF link state request packet to node B until either it gets an LSA or the link is no longer BIDIRECTIONAL.When A receives the LSA database, it responds with a link state ACK packet.If B fails to get a link state ACK within 2 seconds, B retransmits the LSA database. (Remember to not miss sending and receiving HELLO messages while sending a database).B continues to retransmit the LSA database until the link is no longer BIDIRECTIONAL or the entire database has been sent.Note, since both ends will switch the link to bidirectional, both ends will initiate a database exchange
7Reception of link state update A link state update is made up of one or more LSAsWhen an link state update arrives, send a link state ACK to sending node (not quite the standard).For each in the LSA in the updateif the sequence number is larger than the sequence number in the current database thenIf the Link State ID of in the LSA is not the same as this node’s ID, thenUpdate link state databaseFlood this LSA to all neighbor except the one that sent it.elseGenerate a new LSA with sequence number equal to one plus the sequence number in the arrived LSA.Flood this LSA to ALL neighbors.If the LSA sequence number is less than or equal to the one currently in the database, then don’t do anything.
8Reliable FloodingWhen a packet is to be flooded, put it in the ToBeFlooded list.This list should contain the packet to be flooded, the address to where it should be sent and the time out, the next time it should be resent.Hint: Since you should check periodically if packets need to be resent, you can initially put the packet in the list with an expired time out.When you get an ACK, the packet should be removed from the ToBeFlooded list.
9yes yes Initialize Send HELLOs wait for packet arrival (but don’t wait more than 2 sec)receive LS updatereceive HELLOPossibly clearWaitingForUpdateflagForward data packetreceive LS ACKClear entry on ToBeFlooded Listreceive LS requestReply to HELLO ?does updatecontains new LSAs?Reply to HELLOSet Bidirectional?update LSA databaseSetcompute new routing table flagSet BidirectionalandRequest LS updateSet waiting for LS update from XXX flag0Add to ToBeFlooded ListAny LS update requestneed to be resent?Send HELLOs if neededMake new routing tableIf neededsend ToBeFlooded list entriesyesDelete linkSet compute new routingtable flagAny overdue HELLOs?Generate new LSAAdd to be flooded listyesClear LSA with MAXAGEand add ToBeFlooded listAge LSAAny overdue LSA?