The canister is a charcoal filter to stop petrol smells and vapours escaping, all to do with emissions legislation and the tube is just a vent pipe to stop the fuel tanks vacuuming as the fuel pump sucks the petrol out.