why the nonces(N1 and N2) and Timestamps(T1 and T2) are used in Public key Authority? which of them prevent replay attack?
To understand how nonces and timestamps are used to prevent a replay attack, you must understand generally what a replay attack is. A replay attack is a network attack in which a data transmission (that is valid) is repeated or delayed. An attack like this is usually done by an adversary who happens to intercept this data and re-transmits it.
If Alice (Initiator A) and Bob (Responder B) are conversing, Alice can send over a nonce with a MAC which can be checked by Bob to verify that it is Alice and not an adversary sending it.
Timestamping also is important because if Alice sends a message with one, Bob can choose to only accept messages with reasonable timestamps.
So for 'Certificate-Based Key exchanges', Alice provides nonce, or a timestamp along with her certificate. This will help preventing Replay Attacks!