I'm little bit confusing about the flow of things that happen during a voyage of packet in the internet.
my basic question is : What is the connection between OSPF and forwarding tables?
Suppose there are lets say 10 ASes, each AS has some routers and switches within it. Now, host A in some AS want to send IP datagram to host B which is in other AS. Now, first of all, the AS use OSPF protocol. By this, each router know what is the "cost" of send datagram to the another routers in the AS? And another question: when datagram arrives to a router, and in the forwarding table there is no match, it floods to all of its interfaces (?) , but, OSPF give each router the best path it need to choose, so why forwarding tables are needed anyway? i'm so confused and can't find connections between things.
(sorry about the english, it is not my native language)