Source: https://inst.eecs.berkeley.edu/~ee122/sp06/Homeworks/Ethereal_HTTP_Solution.pdf