guys i am reading /proc/net/dev for received and transmitted bytes i am able to calculate in_traffic ,out_traffic but Speed not able to find

delta_time is difference b/w last checked unix time and current unix time

in_traffic = ( ( (new_inbytes - prev_inbytes) * 8 ) /  (delta_time) )
out_traffic = ( ( (new_outbytes -  prev_outbytes) * 8) / (delta_time))

if speed > 0{
        in_utilization = in_traffic / (speed * 10000)
        out_utilization = out_traffic / (speed * 10000)
    }   

please help, thanks