Federer, ranked ninth in the world, made his professional debut in 1998. He has gone on to win 20 grand slam titles, a feat matched by only Rafael Nadal and Djokovic, who tied his rivals with his triumph at Wimbledon in July.
His first grand slam title arrived at Wimbledon in 2003, when Federer was aged just 21. In 2004, 2006 and 2007, he won three out of the four majors on offer.
Federer has six Australian Open titles, eight Wimbledon triumphs, five US Open wins and one French Open success to his name, while he has also won six ATP Tour Finals.
Djokovic and Federer have met 50 times on the ATP circuit, with the Serbian shading their head-to-head record with 27 wins – their most recent encounter coming in the semi-finals of the 2020 Australian Open.
Yet it was he who led the tributes to a true great.
"Hey Roger, happy 40th birthday – 40th, wow, what a milestone! You still keep on inspiring and thriving on the court, off the court, inspiring all of us," Djokovic said in a video posted to the ATP Tour's official Twitter account.
"It's been a huge honour to share the tennis court and the tennis circuit with you in the last 15 years.
"Hopefully you can still keep on playing. The sport needs you, of course, and thanks for everything you have done and thanks for showing us that even at that age we can play at a very high level.
"All the best, I wish you health and love and happiness with your close ones and thanks again for everything."
Kei Nishikori, who has beaten Federer three times and suffered eight defeats to the Swiss, was next up.
"Roger, happy 40th birthday!" Nishikori said.
"You are still my idol, I always looked up to you and I hope we can play a couple more times and I hope you can still keep going and win grand slams."
World number 15 Felix Auger Aliassime shares his birthday with Federer, though the Canadian is some 19 years junior.
"Hey Roger, the big 40, while I'm just turning 21," he said. "It's amazing for the sport that I'm playing and you're still playing at the same time.
"I hope I'll still be playing when I'm 40 as well. Thank you for everything you've been doing for tennis, it's so good to still have you around, I hope you have a great birthday."